8000 Extend patch for torch 2.4.1 to sidestep set_extra_state bit · oracle/graalpython@810f9b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 810f9b6

Browse files
timfelmsimacek
authored andcommitted
Extend patch for torch 2.4.1 to sidestep set_extra_state bit
1 parent 490978a commit 810f9b6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

graalpython/lib-graalpython/patches/torch-2.4.1.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,20 @@ index c301da982..a2668be20 100644
537537
+const int THP_PyOpcode_Caches_size = 0;
538538
+
539539
+#endif // GraalPy change
540+
diff --git a/torch/csrc/dynamo/extra_state.c b/torch/csrc/dynamo/extra_state.c
541+
index cbe9ab37a..18740a0d8 100644
542+
--- a/torch/csrc/dynamo/extra_state.c
543+
+++ b/torch/csrc/dynamo/extra_state.c
544+
@@ -100,9 +100,6 @@ void destroy_extra_state(void* obj) {
545+
}
546+
547+
void set_extra_state(PyCodeObject* code, ExtraState* extra_state) {
548+
- ExtraState* old_extra_state = get_extra_state(code);
549+
- CHECK(extra_state == nullptr || old_extra_state != extra_state);
550+
- _PyCode_SetExtra((PyObject*)code, extra_index, extra_state);
551+
}
552+
553+
ExtraState* init_and_set_extra_state(PyCodeObject* code) {
540554
diff --git a/torch/csrc/dynamo/eval_frame.c b/torch/csrc/dynamo/eval_frame.c
541555
index cbe9ab37a..18740a0d8 100644
542556
--- a/torch/csrc/dynamo/eval_frame.c

0 commit comments

Comments
 (0)
0