Skip to content
Open
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
21 changes: 21 additions & 0 deletions .ci/scripts/test_model_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,27 @@ if [ -n "$EXPECTED_OUTPUT" ]; then
else
echo "SUCCESS: Runner completed successfully"
fi

# Validate GPU peak memory usage for models with known memory budgets.
# The runner prints "GPU peak memory usage: XXXX.X MiB" at the end.
case "$MODEL_NAME" in
qwen3_5_moe)
MAX_MEMORY_MIB=20480 # 20 GB — must fit on a single GPU (e.g. 4090)
PEAK_MEM=$(echo "$OUTPUT" | grep -oP 'GPU peak memory usage: \K[0-9.]+' || true)
if [ -n "$PEAK_MEM" ]; then
# Compare as integers (truncate decimals)
PEAK_MEM_INT=${PEAK_MEM%%.*}
if [ "$PEAK_MEM_INT" -gt "$MAX_MEMORY_MIB" ]; then
echo "FAIL: GPU peak memory ${PEAK_MEM} MiB exceeds budget ${MAX_MEMORY_MIB} MiB"
exit 1
else
echo "Success: GPU peak memory ${PEAK_MEM} MiB within budget (max ${MAX_MEMORY_MIB} MiB)"
fi
else
echo "WARNING: GPU peak memory usage not found in output"
fi
;;
esac
echo "::endgroup::"

popd
11 changes: 0 additions & 11 deletions backends/aoti/aoti_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

class COMPILE_SPEC_KEYS(Enum):
METHOD_NAME = "method_name"
SHARE_KV_CACHE_ACROSS_METHODS = "share_kv_cache_across_methods"


@experimental(
Expand Down Expand Up @@ -287,13 +286,3 @@ def method_name_from_compile_specs(
raise RuntimeError(
f"Could not find method name in compile specs: {compile_specs}"
)

@classmethod
def generate_share_kv_cache_compile_spec(cls) -> CompileSpec:
"""
Generate a CompileSpec to enable cross-method KV cache sharing.
"""
return CompileSpec(
COMPILE_SPEC_KEYS.SHARE_KV_CACHE_ACROSS_METHODS.value,
bytes([1]),
)
Loading
Loading