-
Notifications
You must be signed in to change notification settings - Fork 825
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
add flow.rand #5722
add flow.rand #5722
Conversation
VertexC
commented
Aug 4, 2021
•
edited
Loading
edited
mark。暂时移除 automerge,两个小时以后加回来。 |
有冲突,需要解决一下~ |
Speed stats:
|
template<typename T> | ||
__global__ void GenerateGpu(curandState* state, const int64_t elem_cnt, T* dptr, const T low, | ||
const T high) { | ||
const int id = blockIdx.x * blockDim.x + threadIdx.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个kernel的block_num和thread_num是根据设备上的硬件相关信息计算的,这里并不能保证block_num*thread_num一定 > elem_cnt,所以这个kernel可能会只初始化tensor的前一部分,后一部分保持不变吧,这里应该用 CUDA_1D_KERNEL_LOOP吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,是的,这里确实有问题。@博文 你参考 oneflow/user/kernels/partial_fc_sample_kernel.cu
文件修改一下。