Skip to content

Commit 2034abd

Browse files
hawkinsptensorflower-gardener
authored andcommitted
[XLA:Python] Switch C++ jit dispatch path to use PEP 590 vectorcalls.
vectorcalls were introduced in Python 3.8, and now that we have dropped Python 3.7 there's no downside to using them. ``` name old cpu/op new cpu/op delta jit_simple 3.28µs ±28% 2.94µs ± 2% -10.63% (p=0.027 n=10+8) name old time/op new time/op delta jit_simple 3.29µs ±28% 2.94µs ± 2% -10.62% (p=0.027 n=10+8) ``` Treat the benchmark with a grain of salt: when benchmarking in the 2-3us regime my workstation VM is a bit noisy. PiperOrigin-RevId: 493592959
1 parent 708cbb0 commit 2034abd

File tree

5 files changed

+292
-129
lines changed

5 files changed

+292
-129
lines changed

xla/python/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ cc_library(
398398
":python_utils",
399399
":pytree",
400400
":types",
401+
":util",
401402
"@com_google_absl//absl/container:flat_hash_map",
402403
"@com_google_absl//absl/container:inlined_vector",
403404
"@com_google_absl//absl/strings",
@@ -549,6 +550,7 @@ cc_library(
549550
":py_client",
550551
":python_utils",
551552
":types",
553+
":util",
552554
"@com_google_absl//absl/hash",
553555
"@com_google_absl//absl/strings",
554556
"@com_google_absl//absl/strings:str_format",

0 commit comments

Comments
 (0)