Repository navigation
feat: show tqdm for _ensure_provider_ready - #788
Merged
Merged
Conversation
added 2 commits
May 29, 2026 14:56
xieofxie
commented
Jun 1, 2026
xieofxie
commented
Jun 1, 2026
xieofxie
commented
Jun 1, 2026
added 2 commits
June 1, 2026 15:59
xieofxie
commented
Jun 1, 2026
Qiong Wu (qiowu) (DingmaomaoBJTU)
left a comment
Collaborator
There was a problem hiding this comment.
Nice implementation. The async flow with threading.Event is clean, the timeout is configurable via env var, and tests are thorough. Two minor observations below.
xieofxie
commented
Jun 3, 2026
xieofxie
commented
Jun 4, 2026
Qiong Wu (qiowu) (DingmaomaoBJTU)
approved these changes
Jun 4, 2026
Qiong Wu (qiowu) (DingmaomaoBJTU)
pushed a commit
that referenced
this pull request
Jun 5, 2026
Closes #725 winml sys < <img width="2082" height="252" alt="image" src="https://github.com/user-attachments/assets/6520c1e3-3e17-43cb-907c-4696b0fd6256" /> Failed <img width="2078" height="128" alt="image" src="https://github.com/user-attachments/assets/56de05db-68e2-478a-8326-d1b3bafd605d" /> --------- Co-authored-by: hualxie <hualxie@microsoft.com>
xieofxie
added a commit
that referenced
this pull request
Jul 29, 2026
…1239) ## Summary Restores the EP-download progress bar that previously existed in `ep_registry.py` ([PR #788](#788)) but was dropped during the #1019 EP-discovery refactor, when the `provider.ensure_ready()` call moved into `WinMLCatalogSource._resolve_provider` in `ep_path.py` and lost its progress UX. ## What changed **`src/winml/modelkit/ep_path.py`** — cherry-picked the progress machinery and wired it into the resolve path: - `_ep_download_timeout_default()` + `EP_DOWNLOAD_TIMEOUT_SECONDS` — honors `WINMLCLI_EP_DOWNLOAD_TIMEOUT` (default 5 min). - `_NoopBar` + `_make_progress_bar()` — tqdm bar with a silent fallback when tqdm or `sys.stderr` is unavailable (production installs / spawn workers). - `_parse_ep_metadata_from_path()` — recovers `(version, package_family_name)` from the MSIX `WindowsApps` install path when the native handle reports them empty. - `_ensure_provider_ready()` — prints the `[WinML] Installing Execution Provider` notice, drives a live tqdm bar from `ensure_ready_async`'s `on_progress` callback, waits on `on_complete` with a timeout+cancel, and prints success / ❌-failure guidance plus version/PFN. - `WinMLCatalogSource._resolve_provider` now calls `_ensure_provider_ready(provider)` instead of the silent `provider.ensure_ready()`. ### Note on the sync fast-path The original helper had a `from windowsml import EpReadyState` sync fast-path for already-`Ready` providers. The current `WinMLCatalogSource` deliberately avoids that coupling (string-based readiness checks) and only invokes this helper on the cold, not-Ready path, so the fast-path was dead code — it's dropped, keeping the helper focused purely on the download+progress flow. **Tests** - Added `tests/unit/ep_path/test_ensure_provider_ready.py` — ported the PR #788 coverage (progress bar, stale-callback drop, timeout/cancel, `get_status` error, metadata printing/fallback, failure messages, no-tqdm fallback, timeout-env parsing). - Updated `tests/unit/ep_path/test_winml_catalog_source.py` fakes to the async download contract. ## Verification - `ruff check` clean - `mypy -p winml.modelkit` — no issues (426 files) - `pytest tests/unit/ep_path/` — 178 passed, 2 skipped (EP-install-gated) --------- Co-authored-by: Hualiang Xie <hualxie@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #725
winml sys <
Failed