Skip to content

Commit

Permalink
Remove false flag from temp file
Browse files Browse the repository at this point in the history
Signed-off-by: erman-gurses <[email protected]>
  • Loading branch information
erman-gurses committed Oct 2, 2024
1 parent 0613a77 commit 0c7c829
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions shark_turbine/kernel/wave/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def compile_and_invoke(
_invoke(ctx.vm_context, device, func, kernel_inputs, kernel_outputs)

if run_bench:
bench_with_constant_weights = config.get("backend", False)
bench_with_constant_weights = config.get("bench_with_constant_weights", False)
tempfiles = []
inputs = []
if bench_with_constant_weights:
Expand All @@ -388,7 +388,7 @@ def compile_and_invoke(
)
else:
for inp in kernel_inputs:
tf = tempfile.NamedTemporaryFile(delete=False)
tf = tempfile.NamedTemporaryFile()
torch.save(inp, tf)
tempfiles.append(tf)
inputs.append("@" + tf.name)
Expand All @@ -406,8 +406,6 @@ def compile_and_invoke(
**benchmark_flags,
)
_print_bench_result(benchmark_results, bench_file)
for tf in tempfiles:
tf.close()


def safe_subs(input: Any, subs: List[Tuple[IndexExpr, IndexExpr]]) -> Any:
Expand Down

0 comments on commit 0c7c829

Please sign in to comment.