Skip to content

Instantly share code, notes, and snippets.

@ezyang
Created June 11, 2024 13:49
Show Gist options
  • Save ezyang/4a5138b11327335e618dd37ad2fd0a4e to your computer and use it in GitHub Desktop.
Save ezyang/4a5138b11327335e618dd37ad2fd0a4e to your computer and use it in GitHub Desktop.
diff --git a/fbcode/caffe2/torch/_dynamo/convert_frame.py b/fbcode/caffe2/torch/_dynamo/convert_frame.py
--- a/fbcode/caffe2/torch/_dynamo/convert_frame.py
+++ b/fbcode/caffe2/torch/_dynamo/convert_frame.py
@@ -135,6 +135,8 @@
initial_global_state: Optional[GlobalStateGuard] = None
+DEAD = False
+
@functools.wraps(original_forward_from_src)
def fx_forward_from_src_skip_result(*args, **kwargs):
@@ -730,6 +732,12 @@
return guarded_code
+ global DEAD
+ if DEAD or str(compile_id) in os.getenv("TORCHDYNAMO_SKIP_COMPILE_ID").split(","):
+ DEAD = True
+ log.warning("killing all subsequent compilations")
+ unimplemented("stubbed out")
+
with compile_context(CompileContext(compile_id)):
# Check recompilations
recompile_reasons = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment