Skip to content

random_sample_workspace #92

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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

random_sample_workspace #92

wants to merge 10 commits into from

Conversation

xgqdut2016
Copy link
Collaborator

No description provided.

@xgqdut2016 xgqdut2016 added 模块:算子 添加新的算子 类别:重构 项目结构、接口更改、或重命名 进度:已完成 开发完成,等待审阅合并 labels Oct 31, 2024
@PanZezhong1725 PanZezhong1725 added 类别:优化 功能强化、性能提升 and removed 类别:重构 项目结构、接口更改、或重命名 labels Nov 12, 2024
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from bb29825 to c4bddda Compare November 20, 2024 03:04
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from d453160 to ad66af0 Compare December 10, 2024 02:05
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from 85e1629 to 8068970 Compare December 18, 2024 06:55
@@ -11,15 +11,17 @@ struct RandomSampleCudaDescriptor {
int voc;
DT rDtype;
int rLength;
int step;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

指针偏移请使用size_t, 命名使用offset一类。其余使用int的地方都需要修改,根据情况使用uint64或int64

@@ -30,7 +30,10 @@ class RandomSampleDescriptor(Structure):


def random_sample(data, random_val, topp, topk, voc, temperature, torch_device):
indices = torch.zeros([topk], dtype = torch.int64)
if(torch_device == "cuda"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以均使用int64临时替代,不用再判断cuda了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
模块:算子 添加新的算子 类别:优化 功能强化、性能提升 进度:已完成 开发完成,等待审阅合并
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants