Add native Permuto and multilevel LoD encodings - #538
Draft
shsolanki-1 wants to merge 4 commits into
Draft
Conversation
Dispatch the existing native implementation over the public dimension and feature-width matrix. Canonicalize aliases and validate configuration before template construction while preserving the existing 5D/two-feature artifact contract. Cap AoS transpose geometry so wide outputs stay within CUDA block-size limits.
Wrap any multilevel encoding so Grid and Permuto share one hard or soft LoD path. Preserve base layouts, strides, parameters, streams, and double backward by staging incompatible matrices through the preferred layout and retaining unweighted soft outputs. Expose level counts through the minimal base interface and align Grid derivative cutoffs with the forward predicate at the epsilon boundary.
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
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 24and features per level1, 2, 4, 8.MultiLevelEncodingLoDto wrap multilevel encodings with hard or soft level selection.Motivation
The existing Permuto factory exposes one fixed specialization, and the existing level-of-detail wrapper is tied to Permuto and hard level selection. This change exposes the existing native implementation over a defined configuration matrix and provides one native multilevel LoD wrapper for Permuto and Grid encodings.
Compatibility
The existing five-dimensional configuration with two features per level retains its parameter order, lattice tables, outputs, gradients, and serialized hyperparameters.
n_featuresandn_grid_featuresare accepted as total-feature aliases and serialize to canonicaln_levelsandn_features_per_levelfields.The LoD ratio is scheduler state. Its input gradient remains zero. Nested LoD wrappers are rejected because their mutable level state does not compose consistently.
Validation
TCNN_CUDA_ARCHITECTURES=89.test_permutowith 29 test cases and 425,577 assertions on an RTX 4090.FullyFusedMLPdouble-backward test with 141,383 assertions.git diff --check.Build Impact
The complete native matrix creates 104 Permuto specializations: 13 input dimensions, four feature widths, and two scalar types. In the measured Release build, clean build time increased by 1.2155x,
encoding.cu.oincreased by 2.6306x, andlibtiny-cuda-nn.aincreased by 1.6015x. The retained five-dimensional, two-feature specialization kept the same generated device-code size.Generated inference is intentionally excluded from this PR and is provided by stacked follow-up #539. Generated backward and generated double backward remain unsupported.