Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.7.0][Bug] Fix error with stannum unit tests #8381

Closed
jim19930609 opened this issue Oct 24, 2023 · 0 comments · Fixed by #8393
Closed

[v1.7.0][Bug] Fix error with stannum unit tests #8381

jim19930609 opened this issue Oct 24, 2023 · 0 comments · Fixed by #8393
Assignees
Milestone

Comments

@jim19930609
Copy link
Contributor

Reproduce

cd stannum
python3 -m pytest tests --doctest-modules --junitxml=junit/test-results.xml

Log

Thread 0x00007fc21f964640 (most recent call first):
  File "/usr/lib/python3.10/socket.py", line 293 in accept
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pytest_rerunfailures.py", line 457 in run_server
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Current thread 0x00007fc22349e480 (most recent call first):
  Garbage-collecting
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/_snode/snode_tree.py", line 18 in destroy
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/src/stannum/auxiliary.py", line 62 in destroy
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/src/stannum/auxiliary.py", line 66 in __del__
  File "/usr/lib/python3.10/ast.py", line 50 in parse
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/kernel_impl.py", line 135 in _get_tree_and_ctx
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/kernel_impl.py", line 645 in materialize
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/kernel_impl.py", line 1001 in ensure_compiled
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/kernel_impl.py", line 1033 in __call__
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/shell.py", line 27 in new_call
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/kernel_impl.py", line 1103 in wrapped
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/field.py", line 347 in _from_external_arr
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/util.py", line 334 in wrapped
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/field.py", line 189 in from_torch
  File "/home/taichigraphics/workspace/TaichiRepos/Release/taichi/python/taichi/lang/util.py", line 334 in wrapped
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/src/stannum/tin.py", line 278 in from_torch
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/src/stannum/tin.py", line 344 in forward
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/torch/autograd/function.py", line 506 in apply
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/src/stannum/tin.py", line 171 in forward
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501 in _call_impl
  File "/home/taichigraphics/workspace/TaichiRepos/Release/stannum/tests/test_tin/test_complex_grad.py", line 36 in test_complex_scalar_field
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/python.py", line 195 in pytest_pyfunc_call
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/python.py", line 1789 in runtest
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 167 in pytest_runtest_call
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 260 in <lambda>
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 339 in from_call
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 259 in call_runtest_hook
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 220 in call_and_report
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 131 in runtestprotocol
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/runner.py", line 112 in pytest_runtest_protocol
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/main.py", line 324 in _main
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/main.py", line 270 in wrap_session
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 167 in main
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 190 in console_main
  File "/home/taichigraphics/.local/lib/python3.10/site-packages/pytest/__main__.py", line 5 in <module>
  File "/usr/lib/python3.10/runpy.py", line 86 in _run_code
  File "/usr/lib/python3.10/runpy.py", line 196 in _run_module_as_main

Extension modules: pvectorc, pydantic.typing, pydantic.errors, pydantic.version, pydantic.utils, pydantic.class_validators, pydantic.config, pydantic.color, pydantic.datetime_parse, pydantic.validators, pydantic.networks, pydantic.types, pydantic.json, pydantic.error_wrappers, pydantic.fields, pydantic.parse, pydantic.schema, pydantic.main, pydantic.dataclasses, pydantic.annotated_types, pydantic.decorator, pydantic.env_settings, pydantic.tools, pydantic, zmq.backend.cython.context, zmq.backend.cython.message, zmq.backend.cython.socket, zmq.backend.cython._device, zmq.backend.cython._poll, zmq.backend.cython._proxy_steerable, zmq.backend.cython._version, zmq.backend.cython.error, zmq.backend.cython.utils, tornado.speedups, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, torch._C, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special (total: 54)
段错误 (核心已转储)
@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang Oct 24, 2023
@jim19930609 jim19930609 added this to the v1.7.0 milestone Oct 24, 2023
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Taichi Lang Oct 27, 2023
lin-hitonami added a commit that referenced this issue Oct 27, 2023
Issue: fixes #8381 

### Brief Summary

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at bf37155</samp>

Improve memory management and stability for multiple programs by adding
a `prog` attribute and a validity check to `SNodeTree`.

### Walkthrough

<!--
copilot:walkthrough
-->
### <samp>🤖 Generated by Copilot at bf37155</samp>

* Add `prog` attribute to `SNodeTree` class to store the `Program`
object that created the tree
([link](https://github.com/taichi-dev/taichi/pull/8393/files?diff=unified&w=0#diff-849531f8ac85af8c74b97a8c1fd508026fd881ed796ac10adea483142d90ee32R12))
* Prevent `SNodeTree` from being destroyed by a different or invalid
program by checking the `prog` attribute in the `destroy` method
([link](https://github.com/taichi-dev/taichi/pull/8393/files?diff=unified&w=0#diff-849531f8ac85af8c74b97a8c1fd508026fd881ed796ac10adea483142d90ee32R19-R20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants