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

taichi_ngp example fails on master #6978

Closed
ailzhang opened this issue Dec 26, 2022 · 1 comment · Fixed by #7082
Closed

taichi_ngp example fails on master #6978

ailzhang opened this issue Dec 26, 2022 · 1 comment · Fixed by #7082
Assignees
Labels
bug We've confirmed that this is an BUG

Comments

@ailzhang
Copy link
Contributor

It works in v1.3 and now fails with

  File "/Users/ailzhang/github/taichi/python/taichi/examples/rendering/taichi_ngp.py", line 847, in render
    self.ray_intersect()
  File "/Users/ailzhang/github/taichi/python/taichi/lang/kernel_impl.py", line 1018, in __call__
    raise type(e)('\n' + str(e)) from None
taichi.lang.exception.TaichiTypeError:
File "/Users/ailzhang/github/taichi/python/taichi/examples/rendering/taichi_ngp.py", line 428, in ray_intersect:
            t1t2 = self._ray_aabb_intersec(ray_o, ray_d)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ailzhang/github/taichi/python/taichi/examples/rendering/taichi_ngp.py", line 373, in _ray_aabb_intersec:
        t_min = (self.center - self.half_size - ray_o) * inv_d
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unsupported operand type(s) for '-': '[Tensor (3) f32]' and '[Tensor (3, 1) f16]'

Seems to be related to the slicing behavior of matrix. cc: @jim19930609 @strongoier

@ailzhang ailzhang added the bug We've confirmed that this is an BUG label Dec 26, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Dec 26, 2022
@strongoier
Copy link
Contributor

Seems to be related to the slicing behavior of matrix.

Yep. I'll send a fix for it.

@strongoier strongoier self-assigned this Dec 30, 2022
@feisuzhu feisuzhu moved this from Untriaged to In Progress in Taichi Lang Dec 30, 2022
strongoier added a commit that referenced this issue Jan 6, 2023
…7068)

Issue: #6978, fix #6902

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
PGZXB pushed a commit to PGZXB/taichi that referenced this issue Jan 6, 2023
…aichi-dev#7068)

Issue: taichi-dev#6978, fix taichi-dev#6902

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Taichi Lang Jan 9, 2023
strongoier added a commit that referenced this issue Jan 9, 2023
Issue: fix #6978

### Brief Summary

After #7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 9, 2023
…aichi-dev#7068)

Issue: taichi-dev#6978, fix taichi-dev#6902

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 9, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 12, 2023
…aichi-dev#7068)

Issue: taichi-dev#6978, fix taichi-dev#6902

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 12, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
…aichi-dev#7068)

Issue: taichi-dev#6978, fix taichi-dev#6902

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We've confirmed that this is an BUG
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants