Skip to content

Conversation

@zasdfgbnm
Copy link
Collaborator

@zasdfgbnm zasdfgbnm commented Jan 27, 2026

These tests are actually passing

@zasdfgbnm
Copy link
Collaborator Author

!test

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Review updated until commit 3493086

Description

  • Remove explicit unset(EnableOption::InferContiguity) calls from test setups

  • Replace custom test classes with simple type aliases to NVFuserTest

  • Add EnableOption::InferContiguity to base NVFuserTest configuration

  • Consolidate test configuration to use default NVFuserTest behavior

Changes walkthrough

Relevant files
Tests
9 files
test_alias.cpp
Remove unset InferContiguity from AliasOutputBeforeNonAliasOutput test
+0/-3     
test_indexing_advanced.cpp
Remove InferContiguity setup and simplify test class inheritance
+1/-8     
test_layout_op.cpp
Replace custom LayoutOpTest with NVFuserTest type alias   
+1/-8     
test_loop_domain_scheduling.cpp
Replace custom LoopDomainSchedulingTest with NVFuserTest type alias
+1/-7     
test_low_precision_recipe.cpp
Remove unset InferContiguity from BlockQuantizationSchedulingTest
+0/-1     
test_matmul_scheduler.cpp
Remove set InferContiguity from MatmulFusionTest setup     
+0/-1     
test_pointwise.cpp
Replace custom PointwiseTest with NVFuserTest type alias 
+1/-7     
test_rng.cpp
Replace custom RNGTest with NVFuserTest type alias             
+1/-6     
utils.cpp
Add InferContiguity to base NVFuserTest configuration       
+2/-2     

PR Reviewer Guide

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review
Base class behavior change

The NVFuserTest base class now sets EnableOption::InferContiguity by default in its constructor, which changes the default behavior for all tests. This is a significant behavioral change that should be validated to ensure it doesn't break any existing test assumptions or introduce subtle bugs in edge cases.

EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
EnableOptionsGuard::getCurOptions().set(EnableOption::InferContiguity);

Test failures

  • (Medium, 1) Thunder nvFuser GPT network scalar mismatch in thunder.tests.test_networks

    Test Name A100 Source
    thunder.tests.test_networks.test_nanogpt_complete_autograd_nvfuser_cuda_thunder.dtypes.float32

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

This PR completes the migration to enable InferContiguity by default for all tests. The changes remove all remaining unset(EnableOption::InferContiguity) calls that were preventing specific tests from using contiguity inference.

Key Changes:

  • Removed explicit unset(EnableOption::InferContiguity) calls from 6 test files that were previously incompatible
  • Simplified 5 test fixture classes by converting them to type aliases of NVFuserTest, since custom SetUp() methods are no longer needed
  • Moved IdModel and InferContiguity option setup from SetUp() to the constructor in utils.cpp, making them the default for all tests

Context:
The InferContiguity feature was introduced in PR #5772 to fix issue #4888, where fusion segments were incorrectly assumed to always produce contiguous tensors. Initially, it was an opt-in feature with tests that failed with it enabled having explicit unset() calls. This PR removes those calls, confirming that all affected tests now pass with contiguity inference enabled.

This is a clean-up PR that removes technical debt after the underlying issues have been resolved.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are straightforward test configuration cleanup that removes previously-needed workarounds. The PR author states tests are passing, and the changes are mechanically simple (removing option overrides and simplifying test fixtures). No logic changes or new functionality introduced.
  • No files require special attention

Important Files Changed

Filename Overview
tests/cpp/test_alias.cpp Removed unset(EnableOption::InferContiguity) from AliasOutputBeforeNonAliasOutput test, allowing it to run with contiguity inference enabled
tests/cpp/test_indexing_advanced.cpp Simplified test fixture setup by removing redundant InferContiguity settings and converting AdvancedIndexingIdModelTest to type alias
tests/cpp/test_layout_op.cpp Removed custom SetUp() by converting LayoutOpTest to type alias, relying on base class defaults for InferContiguity
tests/cpp/utils.cpp Moved InferContiguity and IdModel setup from SetUp() to constructor, making them default for all tests

Sequence Diagram

sequenceDiagram
    participant TestRunner
    participant NVFuserTest
    participant EnableOptionsGuard
    participant TestCase
    participant FusionKernelRuntime

    TestRunner->>NVFuserTest: Create test instance
    NVFuserTest->>EnableOptionsGuard: Constructor: set(IdModel)
    NVFuserTest->>EnableOptionsGuard: Constructor: set(InferContiguity)
    Note over NVFuserTest,EnableOptionsGuard: Moved from SetUp() to constructor in utils.cpp
    
    TestRunner->>TestCase: Run test (e.g., AliasTest)
    Note over TestCase: Previously: unset(InferContiguity) here
    Note over TestCase: Now: Uses default enabled InferContiguity
    
    TestCase->>FusionKernelRuntime: Execute fusion
    FusionKernelRuntime->>EnableOptionsGuard: Check isOptionEnabled(InferContiguity)
    EnableOptionsGuard-->>FusionKernelRuntime: true (now enabled)
    FusionKernelRuntime->>FusionKernelRuntime: inferOutputMetaTensor() with contiguity inference
    Note over FusionKernelRuntime: Uses meta device tensors for ExprEval segments
    FusionKernelRuntime-->>TestCase: Returns result with correct contiguity
    
    TestCase-->>TestRunner: Test passes
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Collaborator

@wujingyue wujingyue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also address #5772 (comment) and #5772 (comment)? These extra enablements can be avoided by calling NVFuserTest::SetUp or preferred by moving all enablement to the constructor.

@zasdfgbnm
Copy link
Collaborator Author

!test

@zasdfgbnm
Copy link
Collaborator Author

Can you also address #5772 (comment) and #5772 (comment)? These extra enablements can be avoided by calling NVFuserTest::SetUp or preferred by moving all enablement to the constructor.

Sorry for missing it. Should be fixed now.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@zasdfgbnm zasdfgbnm merged commit b3ef3c2 into main Jan 27, 2026
60 of 62 checks passed
@zasdfgbnm zasdfgbnm deleted the unset-infer-contig branch January 27, 2026 22:21
@wujingyue
Copy link
Collaborator

Sorry for missing it. Should be fixed now.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants