Skip to content

Commit 43755e7

Browse files
committed
fix(ascend): tolerate base-owned triton runtime metadata
1 parent 9bb41cb commit 43755e7

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

tools/install/ascend/install_serve.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,26 @@ install_pip() {
5050
if [ "$DEBUG" != true ]; then
5151
EXPECTED_FLAGTREE_VERSION="$EXPECTED_FLAGTREE_VERSION" python - <<'PY' || return 1
5252
import importlib.metadata as metadata
53+
import importlib.util
5354
import os
5455
55-
expected = os.environ["EXPECTED_FLAGTREE_VERSION"]
56-
actual = metadata.version("flagtree")
57-
assert actual == expected, f"FlagTree version mismatch: expected {expected}, found {actual}"
56+
import triton
5857
59-
import triton # noqa: F401, E402
58+
expected = os.environ["EXPECTED_FLAGTREE_VERSION"]
59+
flagtree_spec = importlib.util.find_spec("flagtree")
60+
if flagtree_spec is None:
61+
print("FlagTree module is not separately installed; using the base Triton runtime")
62+
else:
63+
try:
64+
actual = metadata.version("flagtree")
65+
except metadata.PackageNotFoundError:
66+
print("FlagTree module has no distribution metadata; using the base Triton runtime")
67+
else:
68+
assert actual == expected, (
69+
f"FlagTree version mismatch: expected {expected}, found {actual}"
70+
)
71+
72+
print("Triton runtime:", triton.__file__)
6073
PY
6174
fi
6275
log_success "Ascend serve runtime validated"

0 commit comments

Comments
 (0)