Skip to content
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0eac77b
resolve conflict
savannahostrowski Jul 26, 2024
d576296
tests pass except ssl
savannahostrowski Jun 25, 2024
68e95d6
remove file
savannahostrowski Jul 26, 2024
c903af4
this is broken
savannahostrowski Aug 12, 2024
5ca6b7f
gc approach
savannahostrowski Aug 12, 2024
beb4f65
rebase
savannahostrowski Aug 12, 2024
427dbf5
Update has_run to run_count
savannahostrowski Aug 13, 2024
92d5590
update initialized run_count and move invalidate old
savannahostrowski Aug 13, 2024
0cdf638
set threshold to 1`
savannahostrowski Aug 13, 2024
58e7447
move incrementing run count into a new op
savannahostrowski Aug 14, 2024
6c047e4
add invalidation threshold in gc of 10
savannahostrowski Aug 20, 2024
2645023
move back to incremenet
savannahostrowski Aug 20, 2024
7c7ae98
remove print
savannahostrowski Aug 20, 2024
6d6d306
move invalidation to executor creation
savannahostrowski Aug 27, 2024
4d086fe
change threshold
savannahostrowski Aug 27, 2024
d08e45a
new line
savannahostrowski Aug 27, 2024
6315877
update constant
savannahostrowski Aug 27, 2024
622c266
📜🤖 Added by blurb_it.
blurb-it[bot] Aug 27, 2024
e5117b2
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Aug 29, 2024
7c6704c
resolve conflict
savannahostrowski Jul 26, 2024
1d72fdd
tests pass except ssl
savannahostrowski Jun 25, 2024
1778185
remove file
savannahostrowski Jul 26, 2024
2506821
this is broken
savannahostrowski Aug 12, 2024
fca6dec
gc approach
savannahostrowski Aug 12, 2024
29436fd
rebase
savannahostrowski Aug 12, 2024
b969b11
Update has_run to run_count
savannahostrowski Aug 13, 2024
a669e0f
update initialized run_count and move invalidate old
savannahostrowski Aug 13, 2024
deb73ec
set threshold to 1`
savannahostrowski Aug 13, 2024
9fa55e8
move incrementing run count into a new op
savannahostrowski Aug 14, 2024
e4a461a
add invalidation threshold in gc of 10
savannahostrowski Aug 20, 2024
d5a2bed
move back to incremenet
savannahostrowski Aug 20, 2024
d232e63
remove print
savannahostrowski Aug 20, 2024
e4a456a
move invalidation to executor creation
savannahostrowski Aug 27, 2024
b7d2d5a
change threshold
savannahostrowski Aug 27, 2024
6dcd2dc
new line
savannahostrowski Aug 27, 2024
219f890
update constant
savannahostrowski Aug 27, 2024
fb7b04d
📜🤖 Added by blurb_it.
blurb-it[bot] Aug 27, 2024
ea397a3
Merge branch 'jit-mem-invalidate-10' of https://github.com/savannahos…
savannahostrowski Aug 29, 2024
310d20c
address pr comments
savannahostrowski Aug 30, 2024
d2f9dc4
refactor invalidatecold
savannahostrowski Aug 30, 2024
d755d56
refactor to was_run bool
savannahostrowski Aug 30, 2024
c9534c0
update blurb
savannahostrowski Aug 30, 2024
61cd3c5
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Aug 30, 2024
e5065ad
Update op name to be more reflective of was_run
savannahostrowski Aug 30, 2024
2d09259
fix typo
savannahostrowski Aug 30, 2024
d2e8e29
rename uop
savannahostrowski Aug 30, 2024
a894598
dedent and initialize executors_created
savannahostrowski Aug 31, 2024
758ee03
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Sep 1, 2024
1927bfe
address some PR comments
savannahostrowski Sep 1, 2024
8ee0d7f
Update Python/optimizer.c
savannahostrowski Sep 1, 2024
cedd65d
Update Python/optimizer.c
savannahostrowski Sep 1, 2024
0a9b5b6
make was_run uint`
savannahostrowski Sep 1, 2024
180a68e
add comment for JIT_CLEANUP_THRESHOLD
savannahostrowski Sep 1, 2024
7cb9cba
Remove extraneous reset of executors_created
savannahostrowski Sep 1, 2024
8939ecf
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Sep 3, 2024
00f03d2
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Sep 3, 2024
4981ab2
Merge branch 'jit-mem-invalidate-10' of https://github.com/savannahos…
savannahostrowski Sep 3, 2024
3c59316
condense conditional statements
savannahostrowski Sep 3, 2024
306c3c3
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Sep 10, 2024
fe50615
Address PR comments from Brandt and Mark
savannahostrowski Sep 13, 2024
d51817b
Merge branch 'main' into jit-mem-invalidate-10
savannahostrowski Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ typedef struct _PyExecutorObject {
uint32_t exit_count;
uint32_t code_size;
size_t jit_size;
uint32_t run_count;
void *jit_code;
void *jit_side_entry;
_PyExitData exits[1];
Expand Down Expand Up @@ -123,9 +124,15 @@ PyAPI_FUNC(PyObject *) _PyOptimizer_NewUOpOptimizer(void);
#ifdef _Py_TIER2
PyAPI_FUNC(void) _Py_Executors_InvalidateDependency(PyInterpreterState *interp, void *obj, int is_invalidation);
PyAPI_FUNC(void) _Py_Executors_InvalidateAll(PyInterpreterState *interp, int is_invalidation);
PyAPI_FUNC(void) _Py_Executor_Invalidate(_PyExecutorObject *executor);
PyAPI_FUNC(void) _Py_Executors_InvalidateOld(PyInterpreterState *interp, int is_invalidation);

#else
# define _Py_Executors_InvalidateDependency(A, B, C) ((void)0)
# define _Py_Executors_InvalidateAll(A, B) ((void)0)
# define _Py_Executor_Invalidate(A) ((void)0)
# define _Py_Executors_InvalidateOld(A, B) ((void)0)

#endif


Expand Down
177 changes: 89 additions & 88 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved JIT memory consumption by invalidating cold executors
4 changes: 4 additions & 0 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -4844,6 +4844,10 @@ dummy_func(
assert(((_PyExecutorObject *)executor)->vm_data.valid);
}

tier2 op(_INCREMENT_RUN_COUNT, (--)) {
current_executor->run_count++;
}

tier2 op(_FATAL_ERROR, (--)) {
assert(0);
Py_FatalError("Fatal error uop executed.");
Expand Down
5 changes: 5 additions & 0 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading