Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions csrc/device_lower/id_model_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ namespace nvfuser {

class IdModelOptions {
public:
IdModelOptions()
: tensor_indexer_enabled_(isOptionEnabled(EnableOption::IdModel)) {}

void setTensorIndexer(bool b) {
tensor_indexer_enabled_ = b;
}
Expand All @@ -36,8 +33,8 @@ class IdModelOptions {
}

private:
// Enable TensorIndexer
bool tensor_indexer_enabled_ = false;
// Enable TensorIndexer by default
bool tensor_indexer_enabled_ = true;
};

} // namespace nvfuser
1 change: 0 additions & 1 deletion csrc/device_lower/lower2device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ namespace {
// given Fusion
IdModelOptions getIdModelOptions(Fusion* fusion) {
IdModelOptions options;
options.setTensorIndexer(true);

// If not supported, disable use of TensorIndexer by default. It is
// still used if explicitly opted-in (see, for example,
Expand Down
1 change: 0 additions & 1 deletion csrc/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const std::unordered_map<std::string, EnableOption>& getEnableOptions() {
{"cutlass_scheduler", EnableOption::CutlassScheduler},
{"fuse_matmul", EnableOption::FuseMatmul},
{"fuse_multiple_matmuls", EnableOption::FuseMultipleMatmuls},
{"id_model", EnableOption::IdModel},
{"id_model_extra_validation", EnableOption::IdModelExtraValidation},
{"io_to_lower_precision", EnableOption::IoToLowerPrecision},
{"kernel_db", EnableOption::KernelDb},
Expand Down
1 change: 0 additions & 1 deletion csrc/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ enum class EnableOption {
CutlassScheduler, //! Enable the CUTLASS scheduler and executor
FuseMatmul, //! Enable automatic fusion of matmul and linear ops
FuseMultipleMatmuls, //! Allow fusing more than one matmul in a single kernel
IdModel, //! Enable IdModel
IdModelExtraValidation, //! Enable extra error checking when building IdModel
IoToLowerPrecision, //! Enable castInputOutputToLowerPrecision. #1889 explains
//! why we disabled it by default.
Expand Down
7 changes: 2 additions & 5 deletions python/nvfuser_direct/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,11 @@ def execute(
# Delete the _fusion and reference the fusion inside FusionExecutorCache
del self._fusion

# Add "id_model" as a default enable option
default_enable_options = ["id_model"]
merged_enable_options = default_enable_options + _enable_options

# 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=merged_enable_options,
_enable_options=_enable_options,
_disable_options=_disable_options,
)

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_abstract_tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class AbstractTensorTest : public NVFuserTest {

void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
fusion_ptr_ = std::make_unique<Fusion>();
fusion_guard_ptr_ = std::make_unique<FusionGuard>(fusion_ptr_.get());
auto size = IrBuilder::create<Val>(16, DataType::Index);
Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_allocation_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@

namespace nvfuser {

class AllocationDomainTest : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using AllocationDomainTest = NVFuserTest;

using ::testing::ElementsAre;

Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_allocation_order_inference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ namespace nvfuser {

using testing::ElementsAre;

class AllocationOrderInferenceTest : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using AllocationOrderInferenceTest = NVFuserTest;

std::vector<int64_t> getAllocationOrder(TensorView* tv) {
std::optional<std::vector<int64_t>> permutation =
Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_argsort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@

namespace nvfuser {

class ArgsortTest : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using ArgsortTest = NVFuserTest;

// Parameterized test fixture for BasicExecution with different data types
class ArgsortTestBasicExecution
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_bfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,6 @@ TEST_F(FindAllExprsTest, Rotation) {
std::vector<int64_t> shape({16, 100});

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

auto tv0 = makeConcreteTensor(shape);
fusion.addInput(tv0);
Expand Down
14 changes: 0 additions & 14 deletions tests/cpp/test_circular_buffering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ TEST_F(NVFuserTest, BarSyncWarpSpecializedPointwise) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

int64_t number_of_stages = 4;
int64_t prefetch_distance = 1;
int64_t tensor_outer_dim = 128;
Expand Down Expand Up @@ -99,8 +97,6 @@ TEST_F(NVFuserTest, RegisterSharingCircularBufferingPointwiseCustom) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

int64_t number_of_stages = 4;
int64_t prefetch_distance = 1;
int64_t tensor_outer_dim = 128;
Expand Down Expand Up @@ -183,8 +179,6 @@ TEST_F(NVFuserTest, RegisterSharingCircularBufferingPointwiseNested) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

int64_t number_of_stages = 4;
int64_t prefetch_distance = 1;
int64_t tensor_outer_dim = 128;
Expand Down Expand Up @@ -267,7 +261,6 @@ class CircularBufferingTest : public NVFuserFixtureParamTest<StageAndPrefetch> {
number_of_stages = std::get<0>(GetParam());
prefetch_distance = std::get<1>(GetParam());
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};

Expand Down Expand Up @@ -1101,7 +1094,6 @@ class TmaCircularBufferingTest
// NOTE: Multiple of 16 required for inner dimension
NVF_ERROR(tensor_inner_dim % 16 == 0);
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}

bool testEnablesWarpSpecialization() {
Expand Down Expand Up @@ -1220,8 +1212,6 @@ TEST_F(NVFuserTest, ElectSyncCompatibility) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

TensorView* input = makeContigTensor(3);
fusion->addInput(input);
TensorView* output = set(input);
Expand Down Expand Up @@ -2414,8 +2404,6 @@ TEST_F(NVFuserTest, TmaRegisterSharingDynamicShapesExpectFail) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

auto tv0 = makeContigTensor(2);
fusion->addInput(tv0);

Expand Down Expand Up @@ -2478,8 +2466,6 @@ TEST_P(TmaRegisterSharing, CtaShapeShmoo) {
std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
FusionGuard fg(fusion.get());

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

auto tv0 = makeContigTensor(2);
fusion->addInput(tv0);

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_circular_buffering_ping_pong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ TEST_P(SiblingPingPongCircularBuffering, TwoTmaLoads) {

auto [use_id_model, stage_slice_position] = GetParam();
if (use_id_model) {
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}

std::unique_ptr<Fusion> fusion = std::make_unique<Fusion>();
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ClusterReductionTest : public NVFuserTest,
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
NVFUSER_TEST_CUDA_ARCH_GUARD(9, 0);
}
};
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_combined_inner_outer_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class CombinedSchedulerTest
protected:
void SetUp() override {
NVFuserFixtureParamTest<CombinedSchedulerParams>::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};

Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_compute_with.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ namespace nvfuser {

using namespace at::indexing;

class ComputeWithTest : public NVFuserTest {
protected:
void SetUp() override {
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
NVFuserTest::SetUp();
}
};
using ComputeWithTest = NVFuserTest;

namespace {

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_contiguity_id_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ContigIDGroupsTest : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}

// Helper to construct a simple backward path for testing
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/test_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace nvfuser {

class ExprEvalTest : public NVFuserTest {};
using ExprEvalTest = NVFuserTest;

using ::testing::ElementsAre;
using ::testing::HasSubstr;
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/test_external_src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace nvfuser {

class ExternalSrcExample : public NVFuserTest {};
using ExternalSrcExample = NVFuserTest;

// This is for internal testing only and is intended to be used as a template to
// compile and run an external source file. By default, it should just
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_gather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class GatherTest : public NVFuserTest {
void SetUp() override {
// To make the tests using std::rand deterministic
std::srand(0);
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};

Expand Down
11 changes: 1 addition & 10 deletions tests/cpp/test_gpu1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ namespace nvfuser {

using namespace at::indexing;

class Gpu1Test : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using Gpu1Test = NVFuserTest;

// A few smoke tests for IrGraphGenerator
// (These tests exercise IrGraphGenerator through a non-trivial IR,
Expand Down Expand Up @@ -2803,7 +2797,6 @@ class Fp4CastTest : public NVFuserTest,
public:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
std::tie(dtype_highp, vectorization_factor) = GetParam();
NVFUSER_TEST_CUDA_ARCH_GUARD(10, 0);
}
Expand Down Expand Up @@ -3008,7 +3001,6 @@ class AdvancedDtypeTest : public NVFuserFixtureParamTest<bool> {
bool use_dynamic_shape;
void SetUp() override {
NVFuserFixtureParamTest<bool>::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
use_dynamic_shape = GetParam();
}
};
Expand Down Expand Up @@ -3086,7 +3078,6 @@ class Float4E2m1ManualScheduleTestAllArch
bool dynamic_shape;
void SetUp() override {
NVFuserFixtureParamTest<Float4E2m1ManualScheduleTestParams>::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
std::tie(vectorize_factor, dynamic_shape) = GetParam();
}
};
Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_gpu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ namespace nvfuser {

using namespace at::indexing;

class Gpu2Test : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using Gpu2Test = NVFuserTest;

TEST_F(Gpu2Test, FusionGlobalIntermediate_CUDA) {
Fusion fusion;
Expand Down
10 changes: 1 addition & 9 deletions tests/cpp/test_gpu3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ namespace nvfuser {

using namespace at::indexing;

class Gpu3Test : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using Gpu3Test = NVFuserTest;

TEST_F(Gpu3Test, FusionNonDivisibleSplit1_CUDA) {
Fusion fusion;
Expand Down Expand Up @@ -3400,8 +3394,6 @@ TEST_F(Gpu3Test, FusionIssueRepro1844_CUDA) {
}

TEST_F(Gpu3Test, FusionInsertMagicZero1_CUDA) {
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);

Fusion fusion;
FusionGuard fg(&fusion);

Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_greedy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@

namespace nvfuser {

class GreedySchedulerTest : public NVFuserTest {
protected:
void SetUp() override {
NVFuserTest::SetUp();
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
}
};
using GreedySchedulerTest = NVFuserTest;

class GreedySchedulerTestConstraintSize
: public GreedySchedulerTest,
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/test_index_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ std::vector<SizeParams> generateSizeOneParams() {
class IndexPut : public NVFuserFixtureParamTest<SizeParams> {
protected:
void SetUp() override {
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
NVFuserTest::SetUp();
}
};
Expand Down
8 changes: 1 addition & 7 deletions tests/cpp/test_index_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ void checkIndexSelectVectorization(

} // namespace

class IndexSelectTest : public NVFuserTest {
protected:
void SetUp() override {
EnableOptionsGuard::getCurOptions().set(EnableOption::IdModel);
NVFuserTest::SetUp();
}
};
using IndexSelectTest = NVFuserTest;

TEST_F(IndexSelectTest, Simple1) {
for (int i = 0; i < 5; ++i) {
Expand Down
Loading