Skip to content

Commit

Permalink
[ET-VK][ez] properly parse skip memory metadata pass (#6723)
Browse files Browse the repository at this point in the history
Pull Request resolved: #6712

As title. Currently, the compile option to skip memory metadata tagging is not being passed correctly to `vulkan_preprocess`.
ghstack-source-id: 252359943
@exported-using-ghexport

Differential Revision: [D65600049](https://our.internmc.facebook.com/intern/diff/D65600049/)

Co-authored-by: Stephen Jia <[email protected]>
  • Loading branch information
pytorchbot and SS-JIA authored Nov 7, 2024
1 parent cb2a0e7 commit 39e5b91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backends/vulkan/partitioner/vulkan_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ def parse_compile_options(compile_options: Dict[str, Any]) -> List[CompileSpec]:
value_bytes = int(value).to_bytes(4, byteorder="little")
compile_specs.append(CompileSpec(key, value_bytes))

if isinstance(value, bool):
value_bytes = value.to_bytes(1, byteorder="little")
compile_specs.append(CompileSpec(key, value_bytes))

if key == "texture_limits":
compile_specs.append(
CompileSpec(
Expand Down
4 changes: 4 additions & 0 deletions backends/vulkan/vulkan_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def parse_compile_spec(compile_specs: List[CompileSpec]) -> Dict[str, Any]:
)
if spec.key in {"texture_limits_x", "texture_limits_y", "texture_limits_z"}:
options[spec.key] = int.from_bytes(spec.value, byteorder="little")

if spec.key == "skip_tag_memory_metadata":
options[spec.key] = bool.from_bytes(spec.value, byteorder="little")

# Unhandled options are ignored

return options
Expand Down

0 comments on commit 39e5b91

Please sign in to comment.