File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -392,14 +392,18 @@ def deactivate_impl(self):
392392
393393 def set_cache_dir (self ):
394394 """For each runner name there is separate cache dir."""
395- workspace = ctx .global_context .get (ctx .INPLACE_OPTIMIZE_WORKSPACE_CONTEXT_KEY )
395+ torch_inductor_cache_dir = os .environ .get ("TORCHINDUCTOR_CACHE_DIR" )
396+ if torch_inductor_cache_dir :
397+ LOGGER .debug ("TORCHINDUCTOR_CACHE_DIR: {} set by the user." , torch_inductor_cache_dir )
398+ return
396399
400+ workspace = ctx .global_context .get (ctx .INPLACE_OPTIMIZE_WORKSPACE_CONTEXT_KEY )
397401 if workspace :
398402 workspace = pathlib .Path (workspace )
399403 else :
400- workspace = pathlib .Path ("/tmp/model_navigator/torch_compile_cache" )
404+ workspace = pathlib .Path ("/tmp/model_navigator/. torch_compile_cache" )
401405
402- workspace = workspace / self .name ()
406+ workspace = workspace / self .name () / ".torch_compile_cache"
403407 workspace .mkdir (parents = True , exist_ok = True )
404408
405409 os .environ ["TORCHINDUCTOR_CACHE_DIR" ] = str (workspace )
You can’t perform that action at this time.
0 commit comments