Skip to content

Commit

Permalink
2024-12-14 nightly release (3fcf0bd)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Dec 14, 2024
1 parent 717584c commit 3508627
Show file tree
Hide file tree
Showing 24 changed files with 135 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.hypothesis
buck-out/
buck2-bin/
cmake-out*
.DS_Store
cmake-android-out/
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
set(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
endif()

if(NOT DEFINED FXDIV_SOURCE_DIR)
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG
${CMAKE_POSITION_INDEPENDENT_CODE}
)
set(FXDIV_SOURCE_DIR "backends/xnnpack/third-party/FXdiv")
add_subdirectory("${FXDIV_SOURCE_DIR}")
set(CMAKE_POSITION_INDEPENDENT_CODE
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
)
endif()

if(EXECUTORCH_BUILD_CPUINFO)
# --- cpuinfo
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/tosa_quant_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def quantize_value(x, qargs: QuantArgs, dtype=np.int8):


def dequantize_value(qx, qargs: QuantArgs):
return (qx - qargs.zp) * qargs.scale
return (np.int64(qx) - qargs.zp) * qargs.scale


def qargs_from_qnode(node: torch.fx.Node):
Expand Down
17 changes: 8 additions & 9 deletions backends/vulkan/_passes/tag_memory_meta_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

from executorch.exir.pass_base import ExportPass, PassResult

from torch._subclasses.fake_tensor import FakeTensor

from torch.fx.passes.tools_common import NodeList
from torch.fx.passes.utils.fuser_utils import topo_sort

Expand Down Expand Up @@ -138,9 +136,7 @@ def propose_node_storage(
return storage

for arg in node.args:
if isinstance(arg, torch.fx.Node) and isinstance(
arg.meta["val"], FakeTensor
):
if isinstance(arg, torch.fx.Node) and utils.is_tensor_node(arg):
storage = utils.get_node_storage_type(arg)
if storage is not None and storage in valid_storage_types:
return storage
Expand Down Expand Up @@ -178,9 +174,7 @@ def propose_node_layout(
return layout

for arg in node.args:
if isinstance(arg, torch.fx.Node) and isinstance(
arg.meta["val"], FakeTensor
):
if isinstance(arg, torch.fx.Node) and utils.is_tensor_node(arg):
layout = utils.get_node_memory_layout(arg)
if layout is not None and layout in valid_layouts:
return layout
Expand All @@ -202,14 +196,19 @@ def should_annotate(self, node) -> bool:
if not isinstance(node, torch.fx.Node):
return False

if not isinstance(node.meta["val"], FakeTensor):
if not utils.is_tensor_node(node):
return False

# Storage type and memory layout for tensorref will be determined at runtime
# so there's no use in setting those attributes ahead of time.
if node.meta.get("vkdg_tensorref", False):
return False

# Skip annotating output node. The output tensors should be annotated by the
# time the output node is observed.
if node.op == "output":
return False

return True

def should_delay_annotation(self, node: torch.fx.Node) -> bool:
Expand Down
3 changes: 2 additions & 1 deletion backends/vulkan/docs/android_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ First, build and install ExecuTorch libraries, then build the LLaMA runner
binary using the Android NDK toolchain.

```shell
(rm -rf cmake-android-out && \
./install_requirements.sh --clean
(mkdir cmake-android-out && \
cmake . -DCMAKE_INSTALL_PREFIX=cmake-android-out \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=$ANDROID_ABI \
Expand Down
Loading

0 comments on commit 3508627

Please sign in to comment.