Skip to content

Commit e5a1da1

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Delete llama_quantized lib (pytorch#3119)
Summary: Delete llama_quantized lib, and move embedding_byte.dtype to exir pass Reviewed By: manuelcandales, mikekgfb Differential Revision: D56206703
1 parent 414cd05 commit e5a1da1

File tree

11 files changed

+184
-264
lines changed

11 files changed

+184
-264
lines changed

examples/models/llama2/CMakeLists.txt

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
4444
set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch)
4545

4646
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
47-
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)
4847

4948
if(NOT PYTHON_EXECUTABLE)
5049
resolve_python_executable()
@@ -120,25 +119,9 @@ else()
120119
target_link_options_shared_lib(portable_ops_lib)
121120
endif()
122121

123-
# quantized ops yaml file operation
124-
merge_yaml(
125-
FUNCTIONS_YAML ${CMAKE_CURRENT_SOURCE_DIR}/ops/quantized.yaml
126-
FALLBACK_YAML ${EXECUTORCH_ROOT}/kernels/quantized/quantized.yaml
127-
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
128-
129-
gen_selected_ops("${CMAKE_CURRENT_BINARY_DIR}/merged.yaml" "" "")
130-
generate_bindings_for_kernels(
131-
FUNCTIONS_YAML ${CMAKE_CURRENT_BINARY_DIR}/merged.yaml)
132-
message("Generated files ${gen_command_sources}")
133-
134-
# quantized_merge_ops_lib: Register quantized op kernels into the runtime
135-
gen_operators_lib(
136-
"quantized_merge_ops_lib"
137-
KERNEL_LIBS quantized_kernels
138-
DEPS executorch)
139-
target_include_directories(quantized_merge_ops_lib PUBLIC ${_common_include_directories})
140-
target_link_options_shared_lib(quantized_merge_ops_lib)
141-
list(APPEND link_libraries quantized_kernels quantized_merge_ops_lib)
122+
# quantized_ops_lib: Register quantized op kernels into the runtime
123+
target_link_options_shared_lib(quantized_ops_lib)
124+
list(APPEND link_libraries quantized_kernels quantized_ops_lib)
142125

143126
if(EXECUTORCH_BUILD_CUSTOM)
144127
target_link_options_shared_lib(custom_ops)

examples/models/llama2/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ runtime.python_library(
4242
"//caffe2:torch",
4343
"//executorch/examples/models:model_base",
4444
"//executorch/examples/models/llama2:llama_transformer",
45-
"//executorch/examples/models/llama2/ops:quantized_aot_lib",
4645
],
4746
)
4847

examples/models/llama2/ops/TARGETS

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/models/llama2/ops/quantized.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/models/llama2/ops/quantized_ops.py

Lines changed: 0 additions & 169 deletions
This file was deleted.

examples/models/llama2/ops/targets.bzl

Lines changed: 0 additions & 50 deletions
This file was deleted.

examples/models/llama2/quantize.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import torch
1010
import torch.nn as nn
1111
import torch.nn.functional as F
12-
from .ops.quantized_ops import * # noqa
12+
from executorch.exir.passes._quant_patterns_and_replacements import ( # noqa
13+
quantized_decomposed_lib,
14+
)
1315

1416

1517
try:
@@ -377,7 +379,7 @@ def __init__(
377379

378380
@torch.no_grad()
379381
def forward(self, indices: torch.Tensor) -> torch.Tensor:
380-
return torch.ops.llama_quantized.DEPRECATED_DO_NOT_USE_embedding_byte.dtype(
382+
return torch.ops.quantized_decomposed.embedding_byte.dtype(
381383
self.weight, self.scales, None, 0, 0, indices, dtype=self.dtype
382384
)
383385

examples/models/llama2/runner/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def _get_operator_lib(aten = False):
66
elif runtime.is_oss:
77
return ["//executorch/kernels/portable:generated_lib", "//executorch/examples/models/llama2/custom_ops:custom_ops", "//executorch/examples/models/llama2/ops:generated_lib"]
88
else:
9-
return ["//executorch/configurations:optimized_native_cpu_ops", "//executorch/examples/models/llama2/custom_ops:custom_ops", "//executorch/examples/models/llama2/ops:generated_lib"]
9+
return ["//executorch/configurations:optimized_native_cpu_ops", "//executorch/examples/models/llama2/custom_ops:custom_ops"]
1010

1111
def define_common_targets():
1212
for aten in (True, False):

0 commit comments

Comments
 (0)