Skip to content

Commit 49ca0a4

Browse files
Copilotjustinchuby
andauthored
Merge branch 'main' into justinchuby-add-glm-asr-nano
Resolve conflicts where main independently added pinned HuggingFace revision plumbing to the CLI, ORT-GenAI artifact export, and the staged ORT session teardown. Keep main's revision kwarg handling, drop the duplicated --revision argument and duplicated build() kwarg introduced by the merge, and retain main's upstream asset patching. Signed-off-by: GitHub <[email protected]> Co-authored-by: justinchuby <[email protected]>
2 parents 64c6e2d + b2b8213 commit 49ca0a4

98 files changed

Lines changed: 8124 additions & 230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/golden_regen.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,17 @@ jobs:
7777
if: inputs.device != 'cuda'
7878
run: pip install onnxruntime
7979

80-
- name: Install onnxruntime (GPU)
81-
if: inputs.device == 'cuda'
82-
run: pip install onnxruntime-gpu
83-
8480
- name: Install dependencies
8581
run: |
8682
pip install -r requirements/ci/requirements.txt
8783
pip install -e '.[testing,transformers]'
8884
85+
- name: Install onnxruntime (GPU)
86+
if: inputs.device == 'cuda'
87+
run: |
88+
# Install after project dependencies so the CPU ORT package cannot overwrite it.
89+
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
90+
8991
- name: Reject trust_remote_code cases
9092
run: |
9193
# Safety: never auto-run models that require trust_remote_code

‎.github/workflows/gpu_l4_golden_parity.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ jobs:
6464
pip install -r requirements/ci/requirements.txt
6565
pip install soundfile librosa ml_dtypes flatbuffers numpy packaging protobuf sympy coloredlogs
6666
pip install -e '.[testing,transformers]'
67-
pip install --pre --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/ onnxruntime-gpu onnxruntime-genai-cuda
67+
# PyPI's ORT 1.27+ wheel requires CUDA 13, while these runners use CUDA 12.
68+
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
69+
pip install --no-deps onnxruntime-genai-cuda
6870
6971
- name: Check for golden test data
7072
id: check_golden

‎.github/workflows/gpu_l5_generation_e2e.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ jobs:
6464
pip install -r requirements/ci/requirements.txt
6565
pip install soundfile librosa ml_dtypes flatbuffers numpy packaging protobuf sympy coloredlogs
6666
pip install -e '.[testing,transformers]'
67-
pip install --pre --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/ onnxruntime-gpu onnxruntime-genai-cuda
67+
# PyPI's ORT 1.27+ wheel requires CUDA 13, while these runners use CUDA 12.
68+
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
69+
pip install --no-deps onnxruntime-genai-cuda
6870
6971
- name: Run L5 generation E2E tests
7072
env:

‎.github/workflows/main.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ jobs:
283283
pip install -r requirements/ci/requirements.txt
284284
pip install soundfile librosa ml_dtypes flatbuffers numpy packaging protobuf sympy coloredlogs
285285
pip install -e '.[testing]'
286-
pip install --pre --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/ "onnxruntime-gpu<1.27" onnxruntime-genai-cuda
286+
# PyPI's ORT 1.27+ wheel requires CUDA 13, while these runners use CUDA 12.
287+
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
288+
pip install --no-deps onnxruntime-genai-cuda
287289
- name: Run fast integration tests
288290
env:
289291
HF_TOKEN: ${{ secrets.HF_TOKEN }}

‎.github/workflows/validation_examples_gpu.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
pip install -r requirements/ci/requirements.txt
8484
pip install -e '.[testing,transformers]'
8585
pip install soundfile librosa ml_dtypes flatbuffers numpy packaging protobuf sympy coloredlogs
86-
pip install --pre --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/ onnxruntime-gpu onnxruntime-genai-cuda
86+
# PyPI's ORT 1.27+ wheel requires CUDA 13, while these runners use CUDA 12.
87+
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
88+
pip install --no-deps onnxruntime-genai-cuda
8789
8890
- name: Run ${{ matrix.name }}
8991
env:

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx_copybutton"]
5757
[tool.setuptools.packages.find]
5858
where = ["src"]
5959

60+
[tool.setuptools.package-data]
61+
"mobius.upstream_patches" = ["data/*/*/*.patch", "data/*/*/*.json", "data/*/*/*.md"]
62+
6063
[tool.setuptools.dynamic]
6164
version = { attr = "mobius.__version__" }
6265

‎scripts/generate_golden.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def _generate_causal_lm(case: TestCase, json_path: Path, device: str) -> None:
263263
case.model_id,
264264
dtype=dtype_map[case.dtype],
265265
device=device,
266+
revision=case.revision,
266267
)
267268
else:
268269
model, tokenizer = load_torch_model(
@@ -471,7 +472,10 @@ def _generate_vision_language(case: TestCase, json_path: Path, device: str) -> N
471472
}
472473
torch_dtype = dtype_map.get(case.dtype, torch.float32)
473474
model, _tokenizer, processor = load_torch_multimodal_model(
474-
case.model_id, dtype=torch_dtype, device=device
475+
case.model_id,
476+
dtype=torch_dtype,
477+
device=device,
478+
revision=case.revision,
475479
)
476480

477481
# Load real image/video media from testdata/.
@@ -917,7 +921,9 @@ def _load_speech_language_model(case: TestCase, device: str) -> tuple:
917921
)
918922

919923
model, _tokenizer, processor = load_torch_multimodal_model(
920-
case.model_id, device=device
924+
case.model_id,
925+
device=device,
926+
revision=case.revision,
921927
)
922928
forward_model = model
923929

‎src/mobius/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"BaseModelConfig",
1010
"CausalLMConfig",
1111
"CausalLMTask",
12+
"ComponentInfo",
1213
"DepthAnythingConfig",
1314
"EncoderConfig",
1415
"EpCapabilities",
@@ -48,6 +49,7 @@
4849
"ep_registry",
4950
"get_build_dtype",
5051
"get_ep",
52+
"inspect_components",
5153
"models",
5254
"optimize_model",
5355
"register_ep",
@@ -87,6 +89,7 @@
8789
)
8890
from mobius._constants import OPSET_VERSION
8991
from mobius._execution_providers import EpCapabilities, ep_registry, get_ep, register_ep
92+
from mobius._inspect import ComponentInfo, inspect_components
9093
from mobius._model_package import ModelPackage
9194
from mobius._optimizations import optimize_model
9295
from mobius._registry import (

‎src/mobius/__main__.py‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,17 @@ def _resolve_static_cache_task(model_type: str) -> ModelTask:
345345

346346
hf_config = transformers.AutoConfig.from_pretrained(
347347
model_id_or_path,
348-
revision=revision,
349348
trust_remote_code=trust_remote_code,
349+
revision=revision,
350350
)
351351
task = _resolve_static_cache_task(getattr(hf_config, "model_type", ""))
352352

353353
pkg = build(
354354
model_id_or_path,
355355
task=task,
356-
revision=revision,
357356
dtype=dtype_override,
358357
load_weights=load_weights,
358+
revision=revision,
359359
trust_remote_code=trust_remote_code,
360360
execution_provider=execution_provider,
361361
text_only=args.text_only,
@@ -717,14 +717,6 @@ def main(argv: list[str] | None = None) -> None:
717717
default=None,
718718
help="Model task (auto-detected if not specified). Use 'mobius list tasks' to see available tasks.",
719719
)
720-
build_parser.add_argument(
721-
"--revision",
722-
default=None,
723-
help=(
724-
"Immutable HuggingFace revision used for config, weights, tokenizer, "
725-
"processor, and runtime metadata artifacts."
726-
),
727-
)
728720
build_parser.add_argument(
729721
"--external-data",
730722
choices=["onnx", "safetensors"],
@@ -754,6 +746,14 @@ def main(argv: list[str] | None = None) -> None:
754746
action="store_true",
755747
help="Trust remote code when loading the HuggingFace model config.",
756748
)
749+
build_parser.add_argument(
750+
"--revision",
751+
default=None,
752+
help=(
753+
"Immutable HuggingFace revision used for config, weights, tokenizer, "
754+
"and processor assets."
755+
),
756+
)
757757
build_parser.add_argument(
758758
"--dtype",
759759
choices=sorted(DTYPE_MAP),
@@ -865,7 +865,8 @@ def main(argv: list[str] | None = None) -> None:
865865
"Path to a companion 'clip' mmproj GGUF (vision/audio encoder). "
866866
"When set, builds a full multimodal package (decoder + "
867867
"vision_encoder + embedding) instead of a text-only model. "
868-
"Currently supports Gemma4 vision; audio is experimental."
868+
"Currently supports Gemma4 and Muse Glimmer vision; audio is "
869+
"experimental."
869870
),
870871
)
871872
quantization_group = gguf_parser.add_mutually_exclusive_group()

‎src/mobius/_configs/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
JambaConfig,
4242
JetMoeConfig,
4343
Lfm2Config,
44+
Lfm2VlConfig,
4445
LongcatFlashConfig,
4546
Mamba2Config,
4647
MambaConfig,
@@ -114,6 +115,7 @@
114115
"JambaConfig",
115116
"JetMoeConfig",
116117
"Lfm2Config",
118+
"Lfm2VlConfig",
117119
"LongcatFlashConfig",
118120
"Mamba2Config",
119121
"MambaConfig",

0 commit comments

Comments
 (0)