Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small changes needed to build the CUDA extension on Windows with MSVC. Both are build-time only — no runtime behavior change, and Linux flags are untouched.
1.
templatedisambiguator on dependentdata_ptr<T>()callsflex_gemm/kernels/cuda/spconv/sparse_neighbor_map.cuhas four calls of the form:inside the function templates
hashmap_build_sparse_conv_out_coords<T>andexpand_unique_build_sparse_conv_out_coords<T>. MSVC (with/permissive-) fails to compile these — it doesn't parse<T>as a template argument list in this context. Adding the explicittemplatedisambiguator resolves it:hashmap_keys.template data_ptr<T>()This is valid, well-formed C++ and a no-op for GCC/clang, which already parse the original form fine. Four call sites, lines 114 / 128 / 327 / 341.
2. C++20 for the Windows compile flags
The Windows branch of
setup.pysets/std:c++17and-std=c++17. Current PyTorch headers require C++20, so that block no longer compiles against recent PyTorch (2.13 here). Bumped the three Windows flags to C++20.Scoped to
if platform.system() == "Windows":— the Linux branch below it is unchanged, so existing builds are unaffected.Verification
Builds and runs on Windows 11 / Python 3.13 / CUDA 13.0 / MSVC (VS2022) / PyTorch 2.13 / RTX 5090 (sm_120), exercised through TRELLIS.2's sparse convolution backend (
CONV = 'flex_gemm') and the grid-sample path in its renderers — full image-to-3D generation end to end.I have not rebuilt on Linux. The
templatechange is compiler-agnostic and the flag change is inside the Windows-only branch, so neither should affect Linux builds, but a CI run would confirm.Note
If you'd rather keep C++17 for compatibility with older PyTorch, the flag bump could be made conditional on the detected
torch.__version__. Happy to rework it — I went with the straight bump since the Windows block is already separate and PyTorch itself has moved on.