Skip to content

Conversation

@naoyam
Copy link
Collaborator

@naoyam naoyam commented Jan 30, 2026

The option no longer makes any difference since #5828

@naoyam
Copy link
Collaborator Author

naoyam commented Jan 30, 2026

!test

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Review updated until commit 4641943

Description

  • Remove EnableOption::IdModel from enum and available options

  • Enable TensorIndexer by default in IdModelOptions constructor

  • Remove explicit IdModel enable calls from test files

  • Update Python bindings to remove id_model from default options

Changes walkthrough

Relevant files
Enhancement
5 files
options.h
Remove IdModel from EnableOption enum                                       
+0/-1     
options.cpp
Remove id_model from available options map                             
+0/-1     
id_model_options.h
Enable TensorIndexer by default                                                   
+2/-5     
lower2device.cpp
Remove explicit TensorIndexer enable call                               
+0/-1     
__init__.py
Remove id_model from Python default options                           
+2/-5     
Tests
3 files
utils.cpp
Remove IdModel enable from test setup                                       
+0/-1     
conftest.py
Remove id_model from pytest environment setup                       
+2/-1     
test_with_id_model_indexer.py
Remove explicit id_model environment setting                         
+2/-3     
Additional files
57 files
test_abstract_tensor.cpp +0/-1     
test_allocation_domain.cpp +1/-7     
test_allocation_order_inference.cpp +1/-7     
test_argsort.cpp +1/-7     
test_bfs.cpp +0/-1     
test_circular_buffering.cpp +0/-14   
test_circular_buffering_ping_pong.cpp +0/-1     
test_cluster.cpp +0/-1     
test_combined_inner_outer_reduction.cpp +0/-1     
test_compute_with.cpp +1/-7     
test_contiguity_id_model.cpp +0/-1     
test_evaluator.cpp +1/-1     
test_external_src.cpp +1/-1     
test_gather.cpp +0/-1     
test_gpu1.cpp +1/-10   
test_gpu2.cpp +1/-7     
test_gpu3.cpp +1/-9     
test_greedy.cpp +1/-7     
test_index_put.cpp +0/-1     
test_index_select.cpp +1/-7     
test_indexing.cpp +4/-57   
test_indexing_advanced.cpp +21/-39 
test_inlining.cpp +1/-7     
test_matmul.cpp +0/-3     
test_matmul_scheduler.cpp +0/-3     
test_memory.cpp +1/-5     
test_mma.cpp +0/-4     
test_moe.cpp +0/-1     
test_move_pad.cpp +0/-1     
test_move_repeat_forward.cpp +1/-7     
test_move_split_cat.cpp +1/-7     
test_outer_reduction.cpp +1/-7     
test_persistent_buffer.cpp +1/-8     
test_pointwise.cpp +0/-1     
test_polymorphic_value.cpp +1/-1     
test_predicate_elimination.cpp +1/-7     
test_reduction.cpp +1/-7     
test_reduction_pointwise.cpp +1/-7     
test_remove_bcast_squeeze.cpp +1/-7     
test_replay.cpp +1/-7     
test_reshape.cpp +1/-8     
test_resize.cpp +0/-40   
test_rope.cpp +0/-1     
test_scalar_hoisting.cpp +1/-1     
test_scatter.cpp +0/-2     
test_select.cpp +1/-7     
test_serial_gridreduce.cpp +1/-7     
test_smem_reuse.cpp +1/-1     
test_stream.cpp +1/-3     
test_swizzle.cpp +1/-1     
test_tensor_factories.cpp +1/-1     
test_topk.cpp +1/-7     
test_transpose.cpp +0/-2     
test_unary.cpp +0/-1     
test_vectorization.cpp +1/-8     
test_welford.cpp +1/-7     
utils.h +0/-2     

PR Reviewer Guide

Here are some key observations to aid the review process:

🧪 PR contains tests
⚡ Recommended focus areas for review
Default Behavior Change

The default value of tensor_indexer_enabled_ has been changed from false to true. This is a significant behavioral change that should be verified to not cause regressions in existing functionality.

bool tensor_indexer_enabled_ = true;
API Change Impact

The removal of default "id_model" enable option may affect existing Python code that relies on this being explicitly set. Need to verify backward compatibility.

# Note: id_model is now enabled by default in C++, so no need to add it here
return self.fec.execute(
    inputs,
    device=self._get_device_index(device),
    _enable_options=_enable_options,
    _disable_options=_disable_options,
)
Test Environment Configuration

The change from "id_model,id_model_extra_validation" to just "id_model_extra_validation" in default options should be verified to maintain proper test coverage.

# Note: id_model is now enabled by default, so we only need extra validation
existing = os.environ.get("NVFUSER_ENABLE", "")
new_options = "id_model_extra_validation"

if existing:
    os.environ["NVFUSER_ENABLE"] = f"{existing},{new_options}"

Test failures (partial, pipeline still running)

  • (Medium, 2) Thunder NVFuser nanoGPT autograd scalar mismatch in thunder/tests/test_networks on CUDA

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

@naoyam
Copy link
Collaborator Author

naoyam commented Jan 30, 2026

!test

@naoyam naoyam requested a review from jjsjann123 January 31, 2026 00:30
@naoyam naoyam marked this pull request as ready for review January 31, 2026 00:30
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 31, 2026

Greptile Overview

Greptile Summary

This PR removes the EnableOption::IdModel feature flag, making the IdModel indexer (TensorIndexer) enabled by default instead of opt-in.

Key Changes:

  • Removed EnableOption::IdModel enum value and string mapping from options system
  • Changed IdModelOptions::tensor_indexer_enabled_ default from false to true
  • Removed constructor that checked isOptionEnabled(EnableOption::IdModel)
  • Removed redundant setTensorIndexer(true) call in lower2device.cpp (now default)
  • Updated Python bindings to remove id_model from default enable options
  • Cleaned up 60+ test files by removing explicit EnableOption::IdModel enablement
  • Converted parameterized tests (IdModel vs Legacy) to regular tests (IdModel only)

Impact:
This is a significant architectural change that makes IdModel the default and only indexing approach. The TensorIndexer can still be disabled for unsupported fusions via TensorIndexer::isSupported() check. This simplifies the codebase by removing the dual-mode indexing system.

Confidence Score: 5/5

  • This PR is safe to merge - it's a clean refactoring that makes IdModel the default
  • All changes are consistent and follow a clear pattern: removing opt-in flag and making IdModel default. The fallback mechanism for unsupported fusions is preserved. Test changes are mechanical and thorough.
  • No files require special attention

Important Files Changed

Filename Overview
csrc/options.h Removed IdModel enum value from EnableOption - clean removal
csrc/options.cpp Removed id_model string mapping from enable options - clean removal
csrc/device_lower/id_model_options.h Removed constructor, changed default to enable TensorIndexer by default
csrc/device_lower/lower2device.cpp Removed redundant setTensorIndexer(true) call (now default)
python/nvfuser_direct/init.py Removed id_model from default enable options (now enabled by default in C++)
tests/cpp/utils.h Removed EnableOption::IdModel from test setup (BlackwellBase, TmaBase)
tests/cpp/test_indexing.cpp Removed EnableOption::IdModel calls, converted parameterized tests to regular tests
tests/cpp/test_indexing_advanced.cpp Removed parameterized test instantiation, converted to regular tests

Sequence Diagram

sequenceDiagram
    participant User
    participant Options
    participant IdModelOptions
    participant Lower2Device
    participant TensorIndexer

    Note over Options,TensorIndexer: Before: IdModel was an opt-in feature
    User->>Options: Set EnableOption::IdModel
    Options->>IdModelOptions: Constructor checks isOptionEnabled()
    IdModelOptions->>IdModelOptions: tensor_indexer_enabled = false by default
    Lower2Device->>IdModelOptions: setTensorIndexer(true)
    IdModelOptions->>TensorIndexer: Use TensorIndexer

    Note over Options,TensorIndexer: After: IdModel is always enabled
    User->>Lower2Device: Compile fusion
    Lower2Device->>IdModelOptions: getIdModelOptions()
    IdModelOptions->>IdModelOptions: tensor_indexer_enabled = true by default
    alt Fusion not supported
        Lower2Device->>IdModelOptions: setTensorIndexer(false)
    end
    IdModelOptions->>TensorIndexer: Use TensorIndexer (unless unsupported)
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.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

1 participant