Skip to content

Commit 55de6ec

Browse files
justinchubyCopilot
andcommitted
docs: address all open review comments on PR #117
- README.md: use build() directly (from mobius import build) instead of mobius.build() - execution_providers.md: add 'import onnx_ir as ir' to all code snippets using ir.DataType - execution_providers.md: fix test file reference _common_test.py -> src/mobius/_build_context_test.py - ep_quickstart.md: fix wording 'at optimization time' -> 'during build-time validation, before graph construction or optimization starts' - ep_quickstart.md: fix 'No vendor-specific ops' -> 'No EP-specific vendor fusions (e.g. no GQA/PackQKV)' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
1 parent f8fdef4 commit 55de6ec

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ provider. Pass `execution_provider` to target CUDA, DirectML, WebGPU, and more
7676
each with the right set of fused kernels and lowering passes applied automatically:
7777

7878
```python
79+
from mobius import build
80+
7981
# CUDA: GQA fusion, SkipLayerNorm, PackQKV
80-
pkg = mobius.build("meta-llama/Llama-3.2-1B",
81-
execution_provider="cuda", dtype="f16")
82+
pkg = build("meta-llama/Llama-3.2-1B",
83+
execution_provider="cuda", dtype="f16")
8284

8385
# WebGPU: GQA fusion, Shape ops replaced with portable alternatives
84-
pkg = mobius.build("meta-llama/Llama-3.2-1B",
85-
execution_provider="webgpu", dtype="f16")
86+
pkg = build("meta-llama/Llama-3.2-1B",
87+
execution_provider="webgpu", dtype="f16")
8688
```
8789

8890
See the [EP quickstart](docs/ep_quickstart.md) and

docs/ep_quickstart.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,16 @@ pkg = mobius.build("meta-llama/Llama-3.2-1B",
125125
execution_provider="my-ep", dtype="f16")
126126
```
127127

128-
Unrecognised EP names raise `ValueError` at optimization time — safe-fail by default.
128+
Unrecognised EP names raise `ValueError` during build-time validation, before
129+
graph construction or optimization starts — safe-fail by default.
129130

130131
---
131132

132133
## 5. Common EP configurations at a glance
133134

134135
| Goal | EP | dtype | Notes |
135136
|---|---|---|---|
136-
| Portable ONNX (maximum compatibility) | `"default"` | any | No vendor-specific ops |
137+
| Portable ONNX (maximum compatibility) | `"default"` | any | No EP-specific vendor fusions (e.g. no GQA/PackQKV) |
137138
| ORT CPU inference | `"cpu"` | `"f32"` | GQA fusion for FP32 |
138139
| NVIDIA GPU | `"cuda"` | `"f16"` or `"bf16"` | GQA + SkipNorm + PackQKV |
139140
| Windows GPU (DirectX) | `"dml"` | `"f16"` | RoPE lowered separately |

docs/execution_providers.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ EpCapabilities(name="trt-rtx", gqa_dtypes={FLOAT16, BFLOAT16},
148148
Out-of-tree EPs can register at runtime via `register_ep()`:
149149

150150
```python
151+
import onnx_ir as ir
151152
from mobius import EpCapabilities, register_ep
152153

153154
register_ep(EpCapabilities(
@@ -514,6 +515,7 @@ config)`) and want to control EP capabilities without going through
514515
`build_from_module()`:
515516

516517
```python
518+
import onnx_ir as ir
517519
from mobius import build_context, ep_registry
518520

519521
caps = ep_registry.require("cuda")
@@ -533,7 +535,7 @@ integrating mobius into a custom build pipeline.
533535
| Build from a custom `nn.Module` | `build_from_module()` |
534536
| Optimize an existing `ir.Model` | `optimize_model()` |
535537
| Build graphs with explicit EP context | `build_context()` + `task.build()` |
536-
| Test EP-conditional component logic | `build_context()` (see `_common_test.py`) |
538+
| Test EP-conditional component logic | `build_context()` (see `src/mobius/_build_context_test.py`) |
537539

538540
---
539541

@@ -576,6 +578,7 @@ Advanced users who build graphs outside the standard pipeline can set the
576578
context explicitly:
577579

578580
```python
581+
import onnx_ir as ir
579582
from mobius import build_context, ep_registry
580583

581584
capabilities = ep_registry.require("cuda")
@@ -593,6 +596,7 @@ concurrent builds with different EPs never interfere:
593596

594597
```python
595598
import asyncio
599+
import onnx_ir as ir
596600
from mobius import build_context, ep_registry
597601

598602
async def build_cuda():

0 commit comments

Comments
 (0)