Skip to content

random_sample_workspace - #92

Open
xgqdut2016 wants to merge 10 commits into
devfrom
random_sample_workspace
Open

random_sample_workspace#92
xgqdut2016 wants to merge 10 commits into
devfrom
random_sample_workspace

Conversation

@xgqdut2016

Copy link
Copy Markdown
Collaborator

No description provided.

@xgqdut2016xgqdut2016 added 模块:算子 添加新的算子 类别:重构 项目结构、接口更改、或重命名 进度:已完成 开发完成,等待审阅合并 labels Oct 31, 2024
Comment threadsrc/ops/random_sample/cuda/random_sample.cu
Comment threadsrc/ops/random_sample/cuda/random_sample.cu Outdated
Comment threadsrc/ops/random_sample/cuda/random_sample.cu Outdated
@PanZezhong1725PanZezhong1725 added 类别:优化 功能强化、性能提升 and removed 类别:重构 项目结构、接口更改、或重命名 labels Nov 12, 2024
@xgqdut2016
xgqdut2016force-pushed the random_sample_workspace branch from bb29825 to c4bdddaCompareNovember 20, 2024 03:04
@xgqdut2016
xgqdut2016force-pushed the random_sample_workspace branch from d453160 to ad66af0CompareDecember 10, 2024 02:05
@xgqdut2016
xgqdut2016force-pushed the random_sample_workspace branch from 85e1629 to 8068970CompareDecember 18, 2024 06:55
int voc;
DT rDtype;
int rLength;
int step;

Copy link
Copy Markdown
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


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
Copy Markdown
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 freeto 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

@xgqdut2016@PanZezhong1725