Skip to content

Commit 282c429

Browse files
authored
spam nvrtc options (csarofeen#1783)
TORCH_WARN on nvrtc debug option impacting performance.
1 parent 3ba6a5f commit 282c429

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

torch/csrc/jit/codegen/cuda/executor_utils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,12 @@ std::pair<NvrtcFunction, std::string> nvrtcCompile(
10071007
if (ptxas_opt_level) {
10081008
int val = atoi(ptxas_opt_level);
10091009
if (val <= 4 && val >= 0) {
1010+
if (val < 4) {
1011+
TORCH_WARN(
1012+
"ptxas optimization level manually set as ",
1013+
val,
1014+
", which could negatively affect performance. Try removing env variable PYTORCH_NVFUSER_JIT_OPT_LEVEL for optimal performance.");
1015+
}
10101016
if (compile_to_sass) {
10111017
jit_opt_level += std::to_string(val);
10121018
args.push_back("--ptxas-options");

torch/csrc/jit/codegen/cuda/utils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ auto parseDisableOptions() {
123123
} else if (token == "fallback") {
124124
options_map[DisableOption::Fallback] = true;
125125
} else if (token == "fma") {
126+
TORCH_WARN(
127+
"fmad is disabled for nvrtc, which could negatively affect performance. Try removing `fma` from env variable PYTORCH_NVFUSER_DISABLE for optimal performance.");
126128
options_map[DisableOption::Fma] = true;
127129
} else if (token == "index_hoist") {
128130
options_map[DisableOption::IndexHoist] = true;

0 commit comments

Comments
 (0)