Skip to content

Fix Windows test fixture issues and improve path handling - #6

Merged
chinazhangchao merged 9 commits into
win_rebase/20261016from
chao/fixtests
Oct 28, 2026
Merged

chinazhangchao merged 9 commits into
win_rebase/20261016from
chao/fixtests

Conversation

@chinazhangchao

Copy link
Copy Markdown
Collaborator

No description provided.

chinazhangchao and others added 7 commits October 23, 2026 12:24
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Signed-off-by:  <>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>

Signed-off-by:  <>
Resolve local image paths and convert them with Path.as_uri so Windows drive letters and URI-special filename characters survive media loading. Preserve existing URLs and cover absolute and relative local paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>

Signed-off-by:  <>
Set VLLM_BATCH_INVARIANT through the environment rather than monkeypatching its lazy module attribute. Attribute teardown otherwise materializes False and masks subsequent tests' environment overrides.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>

Signed-off-by:  <>
Torch 2.16.0.dev20261009 still lacks upstream PR 196013. Remove the premature 2.16 cutoff so mutable custom ops with E8M0 inputs are decomposed for both auto-functionalization versions. Keep the backport until the minimum supported Torch actually includes the upstream fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>

Signed-off-by:  <>
Windows PyTorch does not expose HashStore. Use a single-participant FileStore under pytest's temporary directory while preserving the configured Gloo timeout assertion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>

Signed-off-by:  <>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread tests/config/test_config_utils.py Resolved
Comment thread tests/renderers/test_cohere.py Outdated
fake_melody.render_cmd3 = slow_render
fake_melody.render_cmd4 = slow_render
renderer._melody = fake_melody

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe gate mock by platform?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep this mock platform-independent. This test already replaced Melody with blocking render_cmd3/render_cmd4 mocks on every platform: it tests thread-pool offloading and event-loop responsiveness, not Melody integration.

The change injects that same mock during construction instead of afterward, so the optional cohere_melody import cannot fail before the test runs. Gating it to Windows would retain an unnecessary dependency on Linux without adding real Melody coverage. Production imports and rendering are unchanged.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test relying on side effects of _try_import_melody before renderer._melody = fake_melody in linux?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I traced the constructor and async call path and found no required Melody-import side effect for this test:

  • BaseRenderer.__init__ creates the Python thread-pool executor before _try_import_melody() runs.
  • _try_import_melody() only imports and returns the package. The constructor stores that result in self._melody; it does not call any Melody initialization function.
  • _render_async wraps self._render using make_async, which calls loop.run_in_executor. _render reads self._melody when invoked, so both the old and new test execute the same Python slow_render mock, not a Melody binding.

The fixture also disables multimodal processing and uses a mocked tokenizer. Moving the injection earlier leaves the real executor and renderer async path intact; the old import was not needed to set those up. I'm not claiming that importing the third-party package has no side effects in general, or that I ran this on Linux—only that this unit-test path does not consume any such initialization.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep it unchanged in linux, and fix in windows with gate, to make the intent clear.

Comment thread tests/kernels/moe/test_grouped_topk.py Resolved
Comment thread vllm/env_override.py Resolved
Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This reverts commit 3d8213b.

Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@chinazhangchao
chinazhangchao merged commit b2609d4 into win_rebase/20261016 Oct 28, 2026
4 checks passed
vortex-captain pushed a commit that referenced this pull request Nov 2, 2026
Squash the net changes from #6.

* Fix UTF-8 decoding of DeepSeek test fixtures on Windows.
  Read the DeepSeek V4 and V4.1 JSON and golden-text fixtures explicitly
  as UTF-8, independent of the platform's default text encoding.

* Fix platform-native path expectations in Windows tests.
  Compare resolved paths and repository-relative paths using the native
  pathlib string representation.

* Fix Windows file URIs for benchmark image paths.
  Resolve local paths and use Path.as_uri so drive letters and URI-special
  filename characters are preserved. Keep existing URLs unchanged and
  cover absolute and relative paths and encoded image media.

* Fix batch-invariant flag leaking from grouped topk test.
  Set VLLM_BATCH_INVARIANT through the environment instead of materializing
  its lazy module attribute during monkeypatch teardown.

* Keep the Inductor E8M0 pattern matcher backport enabled on Torch nightlies.
  Remove the premature version cutoff for mutable custom-op decomposition
  across both auto-functionalization versions. Track the upstream fix at
  pytorch/pytorch#196013 and remove the backport
  once the minimum supported Torch includes it.

* Use a portable FileStore in the distributed timeout test.
  Replace HashStore with a single-participant FileStore in pytest's
  temporary directory, retaining the configured Gloo timeout assertion.

The temporary Melody import mock and its revert cancel in the aggregate;
no Cohere renderer changes are included.

Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@chinazhangchao
chinazhangchao deleted the chao/fixtests branch November 13, 2026 01:05
vortex-captain pushed a commit that referenced this pull request Nov 19, 2026
Squash the net changes from #6.

* Fix UTF-8 decoding of DeepSeek test fixtures on Windows.
  Read the DeepSeek V4 and V4.1 JSON and golden-text fixtures explicitly
  as UTF-8, independent of the platform's default text encoding.

* Fix platform-native path expectations in Windows tests.
  Compare resolved paths and repository-relative paths using the native
  pathlib string representation.

* Fix Windows file URIs for benchmark image paths.
  Resolve local paths and use Path.as_uri so drive letters and URI-special
  filename characters are preserved. Keep existing URLs unchanged and
  cover absolute and relative paths and encoded image media.

* Fix batch-invariant flag leaking from grouped topk test.
  Set VLLM_BATCH_INVARIANT through the environment instead of materializing
  its lazy module attribute during monkeypatch teardown.

* Keep the Inductor E8M0 pattern matcher backport enabled on Torch nightlies.
  Remove the premature version cutoff for mutable custom-op decomposition
  across both auto-functionalization versions. Track the upstream fix at
  pytorch/pytorch#196013 and remove the backport
  once the minimum supported Torch includes it.

* Use a portable FileStore in the distributed timeout test.
  Replace HashStore with a single-participant FileStore in pytest's
  temporary directory, retaining the configured Gloo timeout assertion.

The temporary Melody import mock and its revert cancel in the aggregate;
no Cohere renderer changes are included.

Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants