Skip to content

Commit

Permalink
removing unused NoOpHeuristic (#3670)
Browse files Browse the repository at this point in the history
1. Removing unused NoOpHeuristic;
2. Moving computation of scheduler/launch params into the block when
it's needed.
  • Loading branch information
jjsjann123 authored Jan 13, 2025
1 parent e286c6f commit de04f12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
8 changes: 4 additions & 4 deletions benchmarks/cpp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ int64_t runBenchmarkIterations(
->groups()
.size() > 1;

const auto& compile_log = executor_cache->getMostRecentExecutorInfo();
auto params = toString(compile_log.params);
auto lparams = toString(
compile_log.fusion_executor->as<KernelExecutor>()->lastLaunchParams());
// Only set if not segmented. In the case of segmented fusions,
// this could be confusing as the log would refect only the last
// segment. Revisit if necessary.
if (!segmented) {
const auto& compile_log = executor_cache->getMostRecentExecutorInfo();
auto params = toString(compile_log.params);
auto lparams = toString(
compile_log.fusion_executor->as<KernelExecutor>()->lastLaunchParams());
benchmark_state.SetLabel(params + lparams);
}

Expand Down
20 changes: 0 additions & 20 deletions csrc/scheduler/no_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,4 @@ class NoOpScheduler : public SchedulerEntry {
}
};

//! Provides a dummy heuristic type to ensure
//! unified interface on NoOp scheduler.
class NoOpHeuristic : public HeuristicParams {
public:
using HeuristicParams::HeuristicParams;
NoOpHeuristic() : HeuristicParams(SchedulerType::NoOp) {};

size_t hash() const override {
return 0;
}
std::unique_ptr<HeuristicParams> clone() const override {
return std::make_unique<NoOpHeuristic>(*this);
}

bool sameAs(const HeuristicParams* other) const override {
auto other_casted = dynamic_cast<const NoOpHeuristic*>(other);
return other_casted != nullptr && other_casted->cparams == cparams;
};
};

} // namespace nvfuser

0 comments on commit de04f12

Please sign in to comment.