Skip to content

Commit

Permalink
Cleanup disableLaunchParamCache.
Browse files Browse the repository at this point in the history
  • Loading branch information
csarofeen committed Jan 1, 2025
1 parent bd1d312 commit b458c7e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
5 changes: 1 addition & 4 deletions csrc/runtime/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,7 @@ void KernelExecutor::compile(
} else if (has_cp_async_bulk) {
// TMA operations require 32-bit indexing.
compile_params.index_type = PrimDataType::Int32;
}

// TODO: Is this necessary?
if (!compile_params.index_type.has_value()) {
} else {
compile_params.index_type = arg_index_type;
}

Expand Down
6 changes: 0 additions & 6 deletions csrc/runtime/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ class KernelExecutor : public ExecutorAbstract {
//! Clear the cached properties of the compiled kernel
void resetCompiledKernelProperties();

void disableLaunchParamCache() {
if (compiledKernel()) {
compiledKernel()->disableLaunchParamCache();
}
}

private:
std::unique_ptr<CompiledKernel> compiled_kernel_;

Expand Down
12 changes: 11 additions & 1 deletion csrc/runtime/fusion_executor_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,17 @@ void FusionExecutorCache::profile(bool to_profile) {
void FusionExecutorCache::disableLaunchParamCache() {
for (auto& it : kernel_runtimes_) {
for (auto& kernel_runtime : it.second) {
kernel_runtime->disableLaunchParamCache();
NVF_CHECK(
kernel_runtime->isCompiled(),
"Tried to set parameters of executors before they were initialized.");
for (auto& executor : kernel_runtime->executors()) {
if (auto ke = dynamic_cast<KernelExecutor*>(executor.get())) {
NVF_CHECK(
ke->compiledKernel(),
"Tried to disable parameter cache of uninitialized CompiledKernel.");
ke->compiledKernel()->disableLaunchParamCache();
}
}
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions csrc/runtime/fusion_kernel_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,6 @@ void FusionKernelRuntime::compileFusionParallel(KernelArgumentHolder args) {
}
}

void FusionKernelRuntime::disableLaunchParamCache() {
NVF_CHECK(
isCompiled(),
"Tried to set parameters of executors before they were initialized.");
for (auto& executor : executors_) {
if (auto ke = dynamic_cast<KernelExecutor*>(executor.get())) {
ke->compiledKernel()->disableLaunchParamCache();
}
}
}

void FusionKernelRuntime::disableKernelLaunch() {
NVF_CHECK(
isCompiled(),
Expand Down
3 changes: 0 additions & 3 deletions csrc/runtime/fusion_kernel_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ class FusionKernelRuntime {
return kernel_time_ms_;
}

//! Internal knob for profiling shape inference
void disableLaunchParamCache();

//! Internal knob for profiling shape inference
void disableKernelLaunch();

Expand Down

0 comments on commit b458c7e

Please sign in to comment.