* optimize moe + lora * more scattermoe optims * selective dequant * add correctness unit tests and benchmarks for scattermoe + lora * handle base+lora split kernel for older moe models * chore: lint * fix casting for H200 and B200 * register pressure estimation and pruning for h200/b200 * use soft limit for pruning * qkv patch for qwen3.5moe * support text_model for qwen3.5 moe * nesting of qwen3 * use udpated cce with zero3 support * Fix decomposed backward for QKV and O projections eliminates B @ A materialization in LoRA attention backward, replacing full [out, in] matmuls with two small [T, R] matmuls.
34 lines
874 B
Python
34 lines
874 B
Python
"""Script to output the correct installation command for cut-cross-entropy."""
|
|
|
|
import importlib.util
|
|
import sys
|
|
|
|
try:
|
|
import torch
|
|
except ImportError as exc:
|
|
raise ImportError("Install torch via `pip install torch`") from exc
|
|
from packaging.version import Version as V
|
|
|
|
USE_UV = "--uv" in sys.argv[1:]
|
|
|
|
v = V(torch.__version__)
|
|
|
|
# no cut-cross-entropy support for torch < 2.4.0
|
|
if v < V("2.4.0"):
|
|
print("")
|
|
sys.exit(0)
|
|
|
|
cce_spec = importlib.util.find_spec("cut_cross_entropy")
|
|
|
|
UNINSTALL_PREFIX = ""
|
|
if cce_spec:
|
|
if not importlib.util.find_spec("cut_cross_entropy.transformers"):
|
|
UNINSTALL_PREFIX = "pip uninstall -y cut-cross-entropy && "
|
|
|
|
UV_PREFIX = "uv " if USE_UV else ""
|
|
|
|
print(
|
|
UNINSTALL_PREFIX
|
|
+ f'{UV_PREFIX}pip install "cut-cross-entropy[transformers] @ git+https://github.com/axolotl-ai-cloud/ml-cross-entropy.git@63b15e6"'
|
|
)
|