Restore async: true across the test suite - #46
Merged
Merged
Conversation
Stream-per-process (M14) + the async enif_send substrate (Phase 1-3) make concurrent Emily.Backend ops safe, so the ExUnit modules that were pinned to async: false for concurrency reasons can now run in parallel. - Refactor `ConformanceHelper` to set `Nx.default_backend/1` in a per-test `setup` (pdict-scoped) rather than `Nx.global_default_backend/1` in `setup_all`; conformance modules (qwen3, vit, whisper) and the `*_full` variants are now async: true. - Refactor the training `*_full` tests and `transform_test.exs` similarly — three MNIST training modules now overlap on `:training_full`. - `distilbert_test.exs` keeps its own `setup_all` + `global_default_backend` and stays async: false: its `:distilbert_full` test drives `Nx.Serving.batched_run` through a supervised serving process, which cannot see the caller's pdict. - Flip the process-scoped modules (compiler, fast/*, stream, async_eval, debug_flags, bumblebee/fast_kernels, compiler_axon) to async: true. - Drop the redundant `on_exit` restores on pdict-setting `setup` blocks — the test process exits anyway and on_exit runs in a different process. Full suite (453 tests incl. all tags): 78.8s, 73.5s async, 5.3s sync.
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.
Summary
Emily.Backendops safe across BEAM processes. This PR flips the ExUnit modules that had been pinned toasync: falsefor concurrency reasons back toasync: true.ConformanceHelpernow setsNx.default_backend/1in a per-testsetup(pdict-scoped) instead ofNx.global_default_backend/1insetup_all. Conformance modules (qwen3, vit, whisper) and the*_fullvariants run async.*_fulltests andtransform_test.exsgot the same treatment — three MNIST modules now overlap on:training_full.distilbert_test.exskeepssetup_all+global_default_backend+async: false, because its:distilbert_fulltest drivesNx.Serving.batched_runthrough a supervised serving process that can't see the caller's pdict.on_exitrestores on pdict-settingsetupblocks — the test process exits anyway andon_exitruns in a different process, so there is nothing to restore.Test plan
mix test(default suite) — 425 tests, 0 failures, 3.0smix test --only conformance— 17 tests, 0 failures, 5.6s (2.5s async)mix test --only training_full— 3 tests, 0 failures, 66.1s all asyncmix test --only qwen3_full --only qwen3_quant_full --only vit_full --only whisper_full --only distilbert_full— 9 tests, 0 failures, 16.4s