-
Notifications
You must be signed in to change notification settings - Fork 0
Test that TORCH_FEATURE_VERSION guards are used where needed #1
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
base: coderabbit_base_20251211_7160
Are you sure you want to change the base?
Test that TORCH_FEATURE_VERSION guards are used where needed #1
Conversation
[ghstack-poisoned]
[ghstack-poisoned]
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Splits each torch library registration in the 2.10 folder into its own file -- I had a script that parsed kernel.cpp to do this but I felt like forcing this responsibility on the user might be less error prone
Compiles each file targetting 2.9 and asserts that compilation fails. (There are 2 2.9 kernels we use as negative tests where compilation is expected to succeed)
Stack from ghstack (oldest at bottom):
PR Type
Tests, Enhancement
Description
Split monolithic kernel.cpp into individual function files for better organization and maintainability
Added comprehensive test suite to verify TORCH_FEATURE_VERSION guards are properly used
Compiles each .cpp and .cu file with TORCH_TARGET_VERSION=2.9.0 and validates compilation fails
Includes negative tests (mv_tensor_accessor_cpu.cpp and mv_tensor_accessor_cuda.cu) to verify test infrastructure correctness
Diagram Walkthrough
File Walkthrough
3 files
Comprehensive test suite for version compatibility validationAdded negative test file for CPU tensor accessor compatibilityAdded negative test file for CUDA tensor accessor compatibility16 files
Removed monolithic kernel file split into individual filesExtracted foreach_mul function into separate fileExtracted foreach_mul_ function into separate fileExtracted make_tensor_clones_and_call_foreach function into separatefileExtracted my_empty function into separate fileExtracted my_reshape function into separate fileExtracted my_view function into separate fileExtracted test_tensor_device function into separate fileExtracted test_device_constructor function into separate fileExtracted test_device_equality function into separate fileExtracted test_device_set_index function into separate fileExtracted test_device_index function into separate fileExtracted test_device_is_cuda function into separate fileExtracted test_device_is_cpu function into separate fileExtracted test_parallel_for function into separate fileExtracted test_get_num_threads function into separate file1 files
Added shared tensor accessor kernel header for CPU and CUDA