Commit c802754
[Kunlunxin] Fix duplicate generation (#332)
<!--
Copyright 2026 FlagOS Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
### PR Category
Vendor
### PR Type
Bug Fixes
### Description
This PR fixes the duplicate generation issue on Kunlunxin by patching
the sampler RNG implementation to ensure consistent sampling behavior
during inference.
### Related Issues
N/A
### Changes
* Patch the sampler RNG implementation for Kunlunxin.
* Fix the duplicate generation issue during model inference.
* Keep the implementation transparent to existing inference workflows.
### Testing
Validated on Kunlunxin hardware with:
* Qwen3.5-35B-A3B
* Qwen3.6-27B
Verified that the duplicate generation issue is resolved on both models.
### Checklist
* [x] I have run the existing tests and they pass
* [ ] I have added tests for my changes (if applicable)
* [ ] I have updated the documentation (if applicable)
Co-authored-by: 0songHan <345279710@qq.com>
Co-authored-by: XMing <xmhubj@gmail.com>1 parent e049130 commit c802754
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
38 | 75 | | |
39 | 76 | | |
40 | 77 | | |
| |||
0 commit comments