Skip to content

Commit

Permalink
Expose caching DebugOptions to python
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-m committed Aug 1, 2024
1 parent 7daa182 commit a75829b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xla/python/xla_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,17 @@ void BuildXlaCompilerSubmodule(nb::module_& m) {
&DebugOptions::xla_gpu_dump_autotune_logs_to,
[](DebugOptions* self, std::string value) {
self->set_xla_gpu_dump_autotune_logs_to(value);
})
.def_prop_rw("xla_gpu_kernel_cache_file",
&DebugOptions::xla_gpu_kernel_cache_file, [](DebugOptions* self, std::string value) {
self->set_xla_gpu_kernel_cache_file(value);
})
.def_prop_rw("xla_gpu_enable_llvm_module_compilation_parallelism",
&DebugOptions::xla_gpu_enable_llvm_module_compilation_parallelism,
&DebugOptions::set_xla_gpu_enable_llvm_module_compilation_parallelism)
.def_prop_rw("xla_gpu_per_fusion_autotune_cache_dir",
&DebugOptions::xla_gpu_per_fusion_autotune_cache_dir, [](DebugOptions* self, std::string value) {
self->set_xla_gpu_per_fusion_autotune_cache_dir(value);
});

nb::class_<ExecutableBuildOptions>(m, "ExecutableBuildOptions")
Expand Down
3 changes: 3 additions & 0 deletions xla/python/xla_extension/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ class DebugOptions:
xla_gpu_dump_autotune_results_to: str
xla_gpu_load_autotune_results_from: str
xla_gpu_dump_autotune_logs_to: str
xla_gpu_kernel_cache_file: str
xla_gpu_enable_llvm_module_compilation_parallelism: bool
xla_gpu_per_fusion_autotune_cache_dir: str

class CompiledMemoryStats:
generated_code_size_in_bytes: int
Expand Down

0 comments on commit a75829b

Please sign in to comment.