Commit 7d9d7af
authored
Added workspace check and reflected this in test (#1991)
<!-- .github/pull_request_template.md -->
## 📌 Description
This PR attempts to fix #1986 (to be confirmed by requester)
The issue is that num_tokens was larger than MAX_TOKEN_NUM, which
results in an IMA, or even in a hang. To address this, I added a
validation check. This required a non-breaking API change:
* create_ipc_workspace_for_all_reduce_fusion now has an optional
"create_metadata" bool, which results in an additional return value
* it is made optional as additional return value could break the API
* trtllm_allreduce_fusion now takes an optional metadata dictionary
* When provided, this will run the validation check
* again, this is also optional, to avoid breaking the api
In addition this PR deprecates the older AllReduce functionality so it can be removed in a major version bump.
## 🔍 Related Issues
<!-- Link any related issues here -->
## 🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.
### ✅ Pre-commit Checks
- [ ] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [ ] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.
> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).
## 🧪 Tests
- [x] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).
## Reviewer Notes
<!-- Optional: anything you'd like reviewers to focus on, concerns, etc.
-->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **API Changes**
* Workspace creation can optionally return metadata describing the
workspace configuration (create_metadata flag).
* Allreduce fusion operations accept optional metadata to validate
runtime parameters against the workspace and raise clear errors on
mismatch.
* A workspace destruction endpoint was renamed for naming consistency.
* Legacy wrappers were marked deprecated and now point users toward the
newer fusion variants.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent c857f09 commit 7d9d7af
File tree
2 files changed
+98
-7
lines changed- flashinfer/comm
- tests/comm
2 files changed
+98
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
393 | 397 | | |
394 | 398 | | |
395 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
| |||
493 | 500 | | |
494 | 501 | | |
495 | 502 | | |
| 503 | + | |
496 | 504 | | |
497 | 505 | | |
498 | 506 | | |
499 | 507 | | |
500 | 508 | | |
501 | 509 | | |
502 | 510 | | |
503 | | - | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
504 | 515 | | |
505 | 516 | | |
506 | 517 | | |
| |||
509 | 520 | | |
510 | 521 | | |
511 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
512 | 530 | | |
513 | 531 | | |
514 | 532 | | |
| |||
517 | 535 | | |
518 | 536 | | |
519 | 537 | | |
520 | | - | |
521 | | - | |
| 538 | + | |
| 539 | + | |
522 | 540 | | |
523 | 541 | | |
524 | 542 | | |
| |||
608 | 626 | | |
609 | 627 | | |
610 | 628 | | |
611 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
612 | 644 | | |
613 | 645 | | |
614 | 646 | | |
| |||
675 | 707 | | |
676 | 708 | | |
677 | 709 | | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
678 | 713 | | |
679 | 714 | | |
680 | 715 | | |
| |||
791 | 826 | | |
792 | 827 | | |
793 | 828 | | |
| 829 | + | |
794 | 830 | | |
795 | 831 | | |
796 | 832 | | |
| |||
815 | 851 | | |
816 | 852 | | |
817 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
818 | 857 | | |
819 | 858 | | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
820 | 906 | | |
821 | 907 | | |
822 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| 218 | + | |
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
| |||
304 | 307 | | |
305 | 308 | | |
306 | 309 | | |
307 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
308 | 313 | | |
309 | 314 | | |
310 | 315 | | |
| |||
0 commit comments