-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jax.random.randint在spu环境下结果似乎不能正确运行 #80
Comments
Hi @Maxime-Tong jax.random 的支持现在的确是有点问题。我来大概解释一下,jax 在生成随机数的过程里用了大量连续的位操作和运算,SPU 因为是用的一个定长的 ring 来模拟所有的整型和浮点数,在这个过程中一旦实际行为和 jax 的预期出现偏差就会导致随机数完全不在范围内 目前的建议是随机数可以在明文里生成然后传给 spu。您提供的这个 repro step 我们会内部分析一下,然后争取在后面的跌代里修复这个问题 祝新年快乐 :P |
好的,谢谢,另外似乎jax提供的三种控制流的方法中, 另同祝新年快乐 : ) |
cond 不应该,while_loop 有个限制是 condition 结果必须是明文的 最好可以提供一个有问题的 example,我来看看 |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [mdutils](https://togithub.com/didix21/mdutils) | `==1.4.0` -> `==1.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/mdutils/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/mdutils/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/mdutils/1.4.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/mdutils/1.4.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>didix21/mdutils (mdutils)</summary> ### [`v1.6.0`](https://togithub.com/didix21/mdutils/blob/HEAD/CHANGELOG.md#v160-2023-04-29) [Compare Source](https://togithub.com/didix21/mdutils/compare/v1.5.1...v1.6.0) [Full Changelog](https://togithub.com/didix21/mdutils/compare/v1.5.1...v1.6.0) **Implemented enhancements:** - DEPRECATION on setup.py [#​80](https://togithub.com/didix21/mdutils/issues/80) - Code adherence to PEP 8 [#​46](https://togithub.com/didix21/mdutils/issues/46) - [GH-80](https://togithub.com/didix21/mdutils/issues/80): Support poetry build system [#​93](https://togithub.com/didix21/mdutils/pull/93) ([didix21](https://togithub.com/didix21)) - [GH-84](https://togithub.com/didix21/mdutils/issues/84): Add types to mdutils methods [#​85](https://togithub.com/didix21/mdutils/pull/85) ([didix21](https://togithub.com/didix21)) **Fixed bugs:** - DeprecationWarning with Python 3.11 [#​90](https://togithub.com/didix21/mdutils/issues/90) **Closed issues:** - Add types on mdutils methods [#​84](https://togithub.com/didix21/mdutils/issues/84) **Merged pull requests:** - [GH-90](https://togithub.com/didix21/mdutils/issues/90): Avoid warning on python 3.11 [#​92](https://togithub.com/didix21/mdutils/pull/92) ([didix21](https://togithub.com/didix21)) - Fix build badge [#​91](https://togithub.com/didix21/mdutils/pull/91) ([didix21](https://togithub.com/didix21)) - [GH-46](https://togithub.com/didix21/mdutils/issues/46): Add flake8 config [#​86](https://togithub.com/didix21/mdutils/pull/86) ([didix21](https://togithub.com/didix21)) - Import coverage to codecov [#​66](https://togithub.com/didix21/mdutils/pull/66) ([didix21](https://togithub.com/didix21)) ### [`v1.5.1`](https://togithub.com/didix21/mdutils/blob/HEAD/CHANGELOG.md#v151-2023-03-11) [Compare Source](https://togithub.com/didix21/mdutils/compare/v1.5.0...v1.5.1) [Full Changelog](https://togithub.com/didix21/mdutils/compare/v1.5.0...v1.5.1) **Fixed bugs:** - MarkDownFile not accepting absolute file path anymore [#​81](https://togithub.com/didix21/mdutils/issues/81) - Fix [#​81](https://togithub.com/didix21/mdutils/issues/81): Absolute path are broken [#​83](https://togithub.com/didix21/mdutils/pull/83) ([didix21](https://togithub.com/didix21)) ### [`v1.5.0`](https://togithub.com/didix21/mdutils/blob/HEAD/CHANGELOG.md#v150-2023-02-11) [Compare Source](https://togithub.com/didix21/mdutils/compare/v1.4.0...v1.5.0) [Full Changelog](https://togithub.com/didix21/mdutils/compare/v1.4.0...v1.5.0) **Implemented enhancements:** - Introduce `header\_id` as parameter for headers [#​78](https://togithub.com/didix21/mdutils/pull/78) ([kieferro](https://togithub.com/kieferro)) **Fixed bugs:** - converting html tables to markdown creates unusable tables [#​73](https://togithub.com/didix21/mdutils/issues/73) **Closed issues:** - Add Id to header [#​77](https://togithub.com/didix21/mdutils/issues/77) - mkreports package [#​71](https://togithub.com/didix21/mdutils/issues/71) **Merged pull requests:** - Update setup-python version [#​79](https://togithub.com/didix21/mdutils/pull/79) ([didix21](https://togithub.com/didix21)) - Modify tests to fix flakiness [#​76](https://togithub.com/didix21/mdutils/pull/76) ([blazyy](https://togithub.com/blazyy)) - Fix typos in README [#​75](https://togithub.com/didix21/mdutils/pull/75) ([kieferro](https://togithub.com/kieferro)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/secretflow/spu). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjcuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Issue Type
Bug
Source
binary
Secretflow Version
0.7.18b0
OS Platform and Distribution
Linux centos 3.10.0
Python version
3.8.13
Bazel version
No response
GCC/Compiler version
No response
What happend and What you expected to happen.
根据jax文档,
jax.random.randint
函数可以根据key生成一个可以选定范围大小的数字,但是在spu环境下,这个范围大小似乎不成立。如下面给出的代码,尝试循环100个epoch,生成100个在[0,5)范围的随机数,统计超出范围的随机数个数。
在jit环境下,返回的统计个数为
0
;而在spu环境下,返回的统计个数却是100
。这是为什么?Reproduction code to reproduce the issue.
The text was updated successfully, but these errors were encountered: