Skip to content

Commit

Permalink
fix (#124)
Browse files Browse the repository at this point in the history
* Remove usage of build.py in favor of setup.py

* fix build script

* fix make_changelog

* fix build script

* fetch git history

* Update unix_build.sh

* sync (#120)

* [ci] Remove build_and_test_cpu_required from CI to save time (#3534)

* remove build and test cpu required

* increase the thread of CPU test to 4

* revert

* [misc] Reorg CI stages (#3525)

* [misc] Reorg CI stages

* install pylint

* [refactor] Remove empty_copy() and copy() from Matrix/Struct (#3536)

* [refactor] Remove empty_copy() and copy() from Matrix/Struct

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [bug] Remove fallback in C++ code (#3538)

* remove fallback in C++ code

* format

* change TI_ERROR to TI_ASSERT

* [Lang] Add check version function to taichi main (#3526)

* [Lang] Add check version function to taichi main

* [Refactor] Fix typo and type in docstring, and format too long string (#3530)

* fix typo and type in docstring, and format too long string

* format type

* [lang] Limit torch based ndarray to cpu/cuda backend. (#3545)

* [lang] Limit torch based ndarray to cpu/cuda backend.

[ghstack-poisoned]

* Update on "[lang] Limit torch based ndarray to cpu/cuda backend."




[ghstack-poisoned]

* Update python/taichi/lang/kernel_impl.py

Co-authored-by: Yi Xu <[email protected]>

Co-authored-by: Yi Xu <[email protected]>

* [refactor] Remove with_entries() and keep_raw from Matrix (#3539)

* [refactor] Remove with_entries() and keep_raw from Matrix

* Auto Format

* Rename Intermediate* to _Intermediate*

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [Lang] Remove disable_local_tensor and empty() from Matrix (#3546)

* Remove disable_local_tensor and empty() from Matrix

* Auto Format

* Fix

Co-authored-by: Taichi Gardener <[email protected]>

* [Lang] [bug] Fix numpy from and to ndarray matrix (#3549)

* Fix fill fromto numpy for matrix element

* Enhance tests for vector and matrix ndarray

* Remove dupl code

* Reorder

* Auto Format

* Remove dependency from base to derived

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [ci] Dockerfile for CPU manylinux2014 compliant (#3542)

* Add dockerfile for manylinux2014 compliant

* Temp disable wheel build using build.py

* [misc] Fix redefined reset function (#3227) (#3521)

* [Misc] [refactor] Move symbol versioning to a new file (#3426)

* Pin glibc version to 2.2.5

* Move wrappers to a separate file

* Auto Format

* Unpin math symbols to enable Vulkan tests

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [Doc] Move build Taichi from source one level up (#3551)

fixes #3550 .

* [CI] Add version database update in CD (#3540)

* [CI] Add version database update in CD

* [misc] Improve the mechanism to find clang (#3379)

* [LLVM] Fix casting f64 to f16 (#3561)

* fix casting f64 to f16

* fix vulkan

* fix test

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [Mesh] Add Meshfor prototype with dirty hacks

* add meshfor class

* runnable till offload

* runnable toy at codegen_cuda

* runnable meshfor for brute force

* fix kernel name in mesh_test

* [Mesh] A simple meshfor frontend enable to print index

* add meshfor frontend to print index

* fix mesh test for new snode api

fix mesh_range after merge taichi

* [Mesh] Fix meshfor at simplify pass

* [Mesh] A Frontend ti.Mesh class prototype

* update

* update

* support load obj

* support load tet

* wip

* [Mesh] A simple BLS pass to do the local to global mapping

* add l2g by internalfuncstmt

* move mesh bls_epilogue generation to bls pass

* [Mesh] [refactor] Create a new pass called make_mesh_attribute_local

* refactor

* [Mesh] Add a backend Mesh class prototype & relation based mesh_for

* wip

* add MeshPtr to MeshFor

* mesh based mesh-for

* bunny.cells

* deprecate ti.mesh_range

* [Mesh] Add MeshPatchIndexStmt statement

* wip

* define stmt ret type

* add todo

* [Mesh] Removed wildcard import in python

* fix

* [Mesh] Make get num_patches behavior correctly

* wip

* [Mesh] Make the type of loop in MeshPatchIndexStmt explicit

* fix

* [Mesh] Add make_mesh_thread_local pass

* wip

* wip

* wip

* passed test

* [Mesh] Fix type_check pass for body_prologue in OffloadedStmt

* Fix type_check pass

* [Mesh] Fix mesh-for in multiple passes

* fix passes for mesh-for

* Fix l2g replacement in the inner scope

* [Mesh] [Lang] New ti.Mesh frontend class prototype & MeshRelationSize statement and expression

* move util functions to backend

* new frontend mesh class

* store mesh info to ctx

* wip

* add MeshRelationSize Stmt & Expression

* use .size instead of len()

* add ret type

* impl high-to-low

* [IR] Quick fix rebase conflict

* [Mesh] [IR] Add MeshRelationAccessStmt & MeshIndexConversionStmt

* add IRs

* fix typo

* [Mesh] Fix code format

* Code format

* code formatter

* [Mesh] Frontend Impl

* frontend wip

* MeshElementFieldProxy & MeshRelationAccessProxy work

* auto format

* [Mesh] MeshRelationAccessStmt & MeshIndexConversionStmt backend implementation

* index conversion wip

* make offload single block in verify pass

* load mesh relation data

* relation access wip

* fix bugs

* optimize codegen

* auto format

* [Mesh] Id property to interact with non-mesh field

* add global id

* auto format

* [Mesh] Clean up field template based residual & fix bugs

* wip

* auto format

* [Mesh] Add analysis pass to gather mesh_for relation types

wip

auto format

* [Mesh] Add analysis pass to gather mesh thread local variables

* wip

* impl

* auto format

* [Mesh] Support low-to-high and same-order relation access

* refactor MeshRelationSizeStmt

* wip

* auto format

* move mesh local to offload

* fix bug

* fix

* stop using is_taichi_class

* auto format

* [Mesh] [refactor] Rename make_mesh_attribute_local to demote_mesh_statements

* rename

* code format

* add todo

* [Mesh] Set MeshTaichi as extension

* add mesh as eextension

* check mesh extenion in frontend

* auto format

* [Mesh] Add optimization pass to make index mapping local

* add compile config

* add pass

* wip

* body_prologue before bls_prologue

* fix bugs

* fix mis-aligned bls

* work

* wip

* auto format

* body_prologue to mesh_prologue

* delete imgui.ini

* [Mesh] [refactor] from_type() as statement attribute

* wip

* auto format

* [Mesh] [opt] Optimize reordered index mapping case

* wip

* add config

* wip

* work

* auto format

* [Mesh] [test] Delete outdated mesh-for test

* delete outdate test

* [Mesh] [refactor] Divide make_mesh_index_mapping_local pass into multiple functions

* wip

* wip

* auto format

* [Mesh] Add ti.mesh_local()

* add mesh_local

* mesh_attr use to desc mesh attributes

* wip

* work

* auto format

* fix typo

* [Mesh] Use ti.axes instead of ti.indices

* quick fix

* [Mesh] [refactor] Rename to_string functions

* refactor

* auto format

* [Mesh] [refactor] Unified MeshRelationAccessStmt and MeshRelationSizeStmt

* wip

* clean duplicate

* refactor frontend_ir

* unify ir printer for MeshRelationAcccessStmt

* fix typo

* auto format

* [Mesh] [refactor] Add global to reordered index mapping type

* add g2r & refactor

* MeshIndexConversionStmt should declare type explicitly

* wip

* clean frontend class

* support python scope ScalarField

* add backend codegen

* support taichi scope

* auto format

* support MatrixField

* MatrixField in taichi scope

* support simplify nested conversion

* [Mesh] Clean MeshAttributeSet in DecoratorRecorder

* clean

* auto format

* [Mesh] Add analyzer to determine which mapping should be cache

* add analyzer

* wip

* auto format

* fix typo

* [Mesh] [Lang] Quick fix rebase conflicts

* [Mesh] [opt] Make mesh attribute local

* rename pass

* wip

* add bls-cache prototype

* wip

* mesh bls analyzer wip

* refactor wip

* read-only works

* calc vol work, mass spring wip

* add an extra simplify pass

* when mapping not in BLS, cache attribute still work

* auto format

* [Mesh] [refactor] Remove MeshAttribute in mesh class

* [Mesh] Add experimental compile configs

* add compile config

* add config comment

* [Mesh] [fix] Fix failed caching mapping only

* fix only cache mapping case

* auto format

* [Mesh] Quick fix bugs after rebase

* [Mesh] Fix Layout.AOS

* [Mesh] Quick fix bugs after rebase

* [Mesh] [opt] Demote no relation access mesh-for to range-for

* support demote mesh-for

* auto format

* remove task type def

* [Mesh] [refactor] Refactor frontend

* move initializers to mesh_builder

* add mesh_builder.link

* apply new json format

* fix a bug caused wrong to_end order

* clean print

* auto format

* [Mesh] Fix bugs to enable nested relation access

* set local relations for ribbons & fix demote mesh statements

* fix nesting relation access in front-end parsing

* auto format

* [Mesh] Fix bugs to enable reordered mesh attribute

* fix bugs to enable reordered mesh attribute

* auto format

* [Mesh] Refactor serialize() for frontend IR

* [Mesh] Reduce SNode trees allocation for ti.Mesh

* [Mesh] Reduce snode trees allocation for ti.Mesh

* auto format

* [Mesh] Fix misc & restore code formatter

* export demote_mesh_for compile config

* delete useless mesh_loader

* simplify reorder definition

* fix

* auto format

* restore code formatter

* [Mesh] Decouple metadata

* decouple mesh metadata to MeshMetadata class

* clean ad-hoc inv_map

* auto format

* [Mesh] Add CI tests for ti.Mesh

* u32 to i32

* auto format

* add ci test & model file

* update gitignore

* [Mesh] Add type_check for ti.Mesh frontend

* [Mesh] [refactor] Migrate ti.Mesh to refactored frontend

* migrate ti.Mesh to refactored frontend

* auto format

* upd

* auto format

* raise syntax error for use keyword as attribute name

* upd

* upd

* remove old frontend

* remove

* avoid duplicate build_stmts

* [Mesh] Support mesh-for for CPU backend

* work with no bls

* work with bls

* update ti.Mesh tests

* auto format

* quick fix

* [Mesh] Remove Matrix.with_entries() & support ti.mesh_patch_idx()

* replace Matrix.with_entries

* support ti.mesh_patch_idx()

* Fix demote to range-for case

* add patch_idx test

* auto format

* quick fix

* [Mesh] [opt] Support mesh-for for multi-CPUs & demote atomic stmts in BLS for x64

* add num_cpu_threads to mesh-for stmt

* fix cpu atomic behavior in mesh bls

* update mesh_local test

* auto format

* quick fix rebase conflict

* reduce git deletions

* fix glad/glfw version

* add new PR tag

* move test model

* fix pylint

* code format

* disable E1101

* [Bug] [metal] Fix data type alignment for arguments and return values (#3564)

* [Bug] [metal] Fix argument alignment problem

* Add comments

* ci (#3569)

* [Bug] [vulkan] Fix data type alignment for arguments and return values (#3571)

* [Bug] [llvm] Fix FP<->UInt castings (#3560)

* [Bug] [llvm] Fix FP<->UInt castings

* Auto Format

Co-authored-by: Taichi Gardener <[email protected]>

* [ci] Remove usage of build.py in favor of setup.py (#3537)

* Remove usage of build.py in favor of setup.py

* fix make_changelog

* fetch git history

* add a script upload_reelase.py

* [ci] Fix release bug

Co-authored-by: lin-hitonami <[email protected]>
Co-authored-by: Tianshu Xu <[email protected]>
Co-authored-by: Yi Xu <[email protected]>
Co-authored-by: Taichi Gardener <[email protected]>
Co-authored-by: gaoxinge <[email protected]>
Co-authored-by: Ailing <[email protected]>
Co-authored-by: Bo Qiao <[email protected]>
Co-authored-by: u2386 <[email protected]>
Co-authored-by: tison <[email protected]>
Co-authored-by: bx2k <[email protected]>
Co-authored-by: g1n0st <[email protected]>
Co-authored-by: Frost Ming <[email protected]>

* Fix (#121)

* fix

* fix

* fix

Co-authored-by: Frost Ming <[email protected]>
Co-authored-by: Bob Cao <[email protected]>
Co-authored-by: lin-hitonami <[email protected]>
Co-authored-by: Tianshu Xu <[email protected]>
Co-authored-by: Yi Xu <[email protected]>
Co-authored-by: Taichi Gardener <[email protected]>
Co-authored-by: gaoxinge <[email protected]>
Co-authored-by: Ailing <[email protected]>
Co-authored-by: Bo Qiao <[email protected]>
Co-authored-by: u2386 <[email protected]>
Co-authored-by: tison <[email protected]>
Co-authored-by: bx2k <[email protected]>
Co-authored-by: g1n0st <[email protected]>
  • Loading branch information
14 people authored Nov 22, 2021
1 parent 9f6522c commit cf51cef
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
- name: Build & Install
run: |
mkdir -m777 wheel
docker create -v `pwd`/wheel:/wheel --user dev --name taichi_build --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/taichi/.github/workflows/scripts/unix_docker_build.sh $PY $GPU_BUILD $PROJECT_NAME "$CI_SETUP_CMAKE_ARGS"
docker create -v `pwd`/wheel:/wheel --user dev --name taichi_build --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/test_actions/.github/workflows/scripts/unix_docker_build.sh $PY $GPU_BUILD $PROJECT_NAME "$CI_SETUP_CMAKE_ARGS"
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx --owner dev --group dev | docker cp - taichi_build:/home/dev/
docker start -a taichi_build
env:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
workflow_dispatch:

env:
PROD_PWD: ${{ secrets.PYPI_PWD_PROD }}
NIGHT_PWD: ${{ secrets.PYPI_PWD_NIGHTLY }}
PROD_PWD: asdf
NIGHT_PWD: ghjk
METADATA_USERNAME: ${{ secrets.METADATA_USERNAME }}
METADATA_PASSWORD: ${{ secrets.METADATA_PASSWORD }}
METADATA_URL: ${{ secrets.METADATA_URL }}
METADATA_URL: llll

jobs:
add_version_to_database:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Build
run: |
mkdir -m777 wheel
docker create -v `pwd`/wheel:/wheel --user dev --name taichi_build --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/taichi/.github/workflows/scripts/unix_docker_build.sh $PY $GPU_BUILD $PROJECT_NAME "$CI_SETUP_CMAKE_ARGS"
docker create -v `pwd`/wheel:/wheel --user dev --name taichi_build --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/test_actions/.github/workflows/scripts/unix_docker_build.sh $PY $GPU_BUILD $PROJECT_NAME "$CI_SETUP_CMAKE_ARGS"
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx --owner dev --group dev | docker cp - taichi_build:/home/dev/
docker start -a taichi_build
env:
Expand All @@ -91,6 +91,7 @@ jobs:
docker create --user dev --name taichi_test --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/unix_docker_test.sh $PY $GPU_TEST
docker cp .github/workflows/scripts/unix_docker_test.sh taichi_test:/home/dev/unix_docker_test.sh
docker cp wheel/*.whl taichi_test:/home/dev/
docker cp ./requirements_test.txt taichi_test:/home/dev/requirements_test.txt
docker cp tests/ taichi_test:/home/dev/
docker start -a taichi_test
env:
Expand All @@ -105,7 +106,7 @@ jobs:
mkdir dist
cp wheel/*.whl dist/
pip install twine requests==2.26
python misc/upload_release.py
python3 misc/upload_release.py
- name: clean docker container
if: always()
Expand Down
25 changes: 13 additions & 12 deletions misc/upload_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,26 @@ def upload_taichi_version():
timeout=5)
response.raise_for_status()
except requests.exceptions.ConnectionError as err:
sys.exit('Updating latest version failed: No internet,', err)
sys.exit('Updating latest version failed: No internet, ' + err.toString())
except requests.exceptions.HTTPError as err:
sys.exit('Updating latest version failed: Server error,', err)
sys.exit('Updating latest version failed: Server error, ' + err.toString())
except requests.exceptions.Timeout as err:
sys.exit(
'Updating latest version failed: Time out when connecting server,',
err)
'Updating latest version failed: Time out when connecting server, '
+ err.toString())
except requests.exceptions.RequestException as err:
sys.exit('Updating latest version failed:', err)
sys.exit('Updating latest version failed: ' + err.toString())
response = response.json()
print(response['message'])


def upload_artifact():
is_nightly = os.getenv('PROJECT_NAME', 'taichi') == 'taichi'
pwd_env = 'PROD_PWD' if is_nightly else 'NIGHT_PWD'
def upload_artifact(is_taichi):
pwd_env = 'PROD_PWD' if is_taichi else 'NIGHT_PWD'
twine_password = os.getenv(pwd_env)
if not twine_password:
sys.exit(f'Missing password env var {pwd_env}')
command = ["twine", "upload"]
if is_nightly:
command = ["python", "-m", "twine", "upload"]
if is_taichi :
command.extend(['--repository', 'testpypi'])
command.extend(
['--verbose', '-u', '__token__', '-p', twine_password, 'dist/*'])
Expand All @@ -51,5 +50,7 @@ def upload_artifact():


if __name__ == '__main__':
upload_taichi_version()
upload_artifact()
is_taichi = os.getenv('PROJECT_NAME', 'taichi') == 'taichi'
if is_taichi :
upload_taichi_version()
upload_artifact(is_taichi)
18 changes: 0 additions & 18 deletions python/taichi/lang/_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,6 @@ def ndarray_matrix_from_numpy(self, arr, as_vector):
taichi.lang.meta.ext_arr_to_ndarray_matrix(arr, self, as_vector)
impl.get_runtime().sync()

@python_scope
def get_element_size(self):
"""Returns the size of one element in bytes.
Returns:
Size in bytes.
"""
return self.arr.element_size()

@python_scope
def get_nelement(self):
"""Returns the total number of elements.
Returns:
Total number of elements.
"""
return self.arr.nelement()

@python_scope
def copy_from(self, other):
"""Copies all elements from another ndarray.
Expand Down
21 changes: 0 additions & 21 deletions tests/python/test_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,27 +603,6 @@ def test_arg_not_match():
_test_arg_not_match()


def _test_size_in_bytes():
a = ti.ndarray(ti.i32, 8)
assert a.get_element_size() == 4
assert a.get_nelement() == 8

b = ti.Vector.ndarray(10, ti.f64, 5)
assert b.get_element_size() == 8
assert b.get_nelement() == 50


@pytest.mark.skipif(not ti.has_pytorch(), reason='Pytorch not installed.')
@ti.test(arch=[ti.cpu, ti.cuda])
def test_size_in_bytes_torch():
_test_size_in_bytes()


@ti.test(arch=[ti.cpu, ti.cuda], ndarray_use_torch=False)
def test_size_in_bytes():
_test_size_in_bytes()


@ti.test(arch=ti.opengl, ndarray_use_torch=True)
def test_torch_based_ndarray_opengl():
x = ti.ndarray(ti.f32, shape=(4, 2))
Expand Down

0 comments on commit cf51cef

Please sign in to comment.