Skip to content

[Executorch][llama] Renamed quantized_kv_cache to custom_kv_cache #9944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/models/llama/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ runtime.python_library(
"source_transformation/pre_quantization.py",
"source_transformation/prune_vocab.py",
"source_transformation/quantize.py",
"source_transformation/quantized_kv_cache.py",
"source_transformation/custom_kv_cache.py",
"source_transformation/rms_norm.py",
"source_transformation/rope.py",
"source_transformation/sdpa.py",
Expand Down Expand Up @@ -208,9 +208,9 @@ runtime.python_library(
)

runtime.python_library(
name = "quantized_kv_cache",
name = "custom_kv_cache",
srcs = [
"source_transformation/quantized_kv_cache.py",
"source_transformation/custom_kv_cache.py",
],
_is_external_target = True,
visibility = ["//executorch/..."],
Expand Down Expand Up @@ -240,7 +240,7 @@ runtime.python_test(
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
],
deps = [
":quantized_kv_cache",
":custom_kv_cache",
"//caffe2:torch",
"//executorch/examples/models/llama:llama_transformer",
],
Expand All @@ -255,7 +255,7 @@ runtime.python_test(
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
],
deps = [
":quantized_kv_cache",
":custom_kv_cache",
":sdpa",
"//caffe2:torch",
"//executorch/examples/models/llama:llama_transformer",
Expand Down
8 changes: 4 additions & 4 deletions examples/models/llama/export_llama_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
)

from .source_transformation.attention import replace_attention_to_attention_sha
from .source_transformation.custom_kv_cache import (
replace_kv_cache_with_custom_kv_cache,
replace_kv_cache_with_quantized_kv_cache,
)
from .source_transformation.quantize import (
get_quant_embedding_transform,
get_quant_weight_transform,
)
from .source_transformation.quantized_kv_cache import (
replace_kv_cache_with_custom_kv_cache,
replace_kv_cache_with_quantized_kv_cache,
)
from .source_transformation.rms_norm import replace_rms_norm_with_native_rms_norm

from .source_transformation.rope import materialze_broadcast_of_rope_freq_cis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from executorch.examples.models.llama.attention import KVCache

from executorch.examples.models.llama.source_transformation.quantized_kv_cache import (
from executorch.examples.models.llama.source_transformation.custom_kv_cache import (
QuantizedCacheType,
QuantizedKVCache,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from executorch.examples.models.llama.attention import KVCache

from executorch.examples.models.llama.source_transformation.quantized_kv_cache import (
from executorch.examples.models.llama.source_transformation.custom_kv_cache import (
CustomKVCache,
QuantizedCacheType,
QuantizedKVCache,
Expand Down
6 changes: 3 additions & 3 deletions examples/models/llava/export_llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
build_args_parser,
get_quantizer_and_quant_params,
)
from executorch.examples.models.llama.source_transformation.custom_kv_cache import (
replace_kv_cache_with_custom_kv_cache,
)
from executorch.examples.models.llama.source_transformation.quantize import (
EmbeddingQuantHandler,
get_quant_weight_transform,
)
from executorch.examples.models.llama.source_transformation.quantized_kv_cache import (
replace_kv_cache_with_custom_kv_cache,
)
from executorch.examples.models.llama.source_transformation.sdpa import (
replace_sdpa_with_custom_op,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/models/llava/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from executorch.examples.models.llama.llama_transformer import Transformer
from executorch.examples.models.llama.model_args import ModelArgs

from executorch.examples.models.llama.source_transformation.quantized_kv_cache import (
from executorch.examples.models.llama.source_transformation.custom_kv_cache import (
replace_kv_cache_with_custom_kv_cache,
)
from executorch.examples.models.llama.source_transformation.sdpa import (
Expand Down
Loading