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

Fix autodiff issue for vector<T, N> #6275

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

kaizhangNV
Copy link
Contributor

Close #6154

We didn't implement correctly for vector<T, N> regarding the differentiablity. As we check differentiable before specialization, however according to the definition of vector, it has to be specialized to IFloat to know it's conformed to IDifferential type. Therefore for parameter type vector<T, N> will become no_diff.

Therefore, we change the implementation a to make it explicit conform to IDifferential type.

@kaizhangNV kaizhangNV requested a review from a team as a code owner February 4, 2025 20:29
@kaizhangNV kaizhangNV added the pr: non-breaking PRs without breaking changes label Feb 4, 2025
@kaizhangNV
Copy link
Contributor Author

It passes test_torchintegration.py on my local.

Close shader-slang#6154

We didn't implement correctly for vector<T, N> regarding the
differentiablity. As we check differentiable before specialization,
however according to the definition of vector, it has to be specialized
to IFloat to know it's conformed to IDifferential type. Therefore for
parameter type vector<T, N> will become no_diff.

Therefore, we change the implementation a to make it explicit conform
to IDifferential type.
@csyonghe csyonghe merged commit 4b35064 into shader-slang:master Feb 5, 2025
16 checks passed
jkwak-work added a commit to jkwak-work/slang that referenced this pull request Feb 14, 2025
@kaizhangNV kaizhangNV deleted the debug_slangpy branch February 24, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[slangpy] Torch integration test failure
2 participants