Skip to content

Commit

Permalink
Minor fix for bug introduced in D58972675
Browse files Browse the repository at this point in the history
Reviewed By: chenyang78

Differential Revision: D59015737

fbshipit-source-id: fe4f97194282894d29bc8f2e4f10fe3bb4d13a2a
  • Loading branch information
int3 authored and facebook-github-bot committed Jun 25, 2024
1 parent 4720ea4 commit a751628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchbenchmark/util/triton_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def get_example_inputs(self):
except StopIteration:
return None

def get_temp_path(path: Union[str, Path]) -> Path:
def get_temp_path(self, path: Union[str, Path]) -> Path:
return Path(tempfile.gettempdir()) / "tritonbench" / self.name / Path(path)

def _get_accuracy(self, fn: Callable, baseline_fn: Callable) -> bool:
Expand Down Expand Up @@ -932,7 +932,7 @@ def ncu_trace(self, input_id: int, fn_name: str, replay: bool=False) -> str:
warnings.warn(
"DCGM may not have been successfully disabled. Proceeding to collect NCU trace anyway..."
)
ncu_output_dir = self.get_temp_path("ncu_traces/{fn_name}_{input_id}")
ncu_output_dir = self.get_temp_path(f"ncu_traces/{fn_name}_{input_id}")
ncu_output_dir.mkdir(parents=True, exist_ok=True)
ext = ".csv" if not replay else ".ncu-rep"
ncu_output_file = ncu_output_dir.joinpath(f"ncu_output{ext}").resolve()
Expand Down Expand Up @@ -972,7 +972,7 @@ def kineto_trace(self, input_id: int, fn: Callable) -> str:
from pathlib import Path
from torchbenchmark._components.kineto import do_bench_kineto

kineto_output_dir = self.get_temp_path("kineto_traces/{fn._name}_{input_id}")
kineto_output_dir = self.get_temp_path(f"kineto_traces/{fn._name}_{input_id}")
kineto_output_dir.mkdir(parents=True, exist_ok=True)
return do_bench_kineto(
fn=fn,
Expand Down

0 comments on commit a751628

Please sign in to comment.