Skip to content

issue/20:寒武纪平台针对任意维度的swiglu算子重构 - #57

Closed
xgqdut2016 wants to merge 1 commit into
mainfrom
issue/20
Closed

xgqdut2016 wants to merge 1 commit into
mainfrom
issue/20

Conversation

@xgqdut2016

Copy link
Copy Markdown
Collaborator
1739861219323

@xgqdut2016 xgqdut2016 linked an issue Feb 18, 2025 that may be closed by this pull request
int device_id;
infiniDtype_t dtype;
int ndim;
int *shape;

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,步长使用ptrdiff_t。如硬件有限制,可以使用硬件认可的类型

#include "../../utils.h"
#include "swiglu_bang_api.h"

const int SRC_MAX_SIZE = 1024 * 32;//至少大于等于128字节

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.

这种是不是应该放在common代码里

#define __INFINIOP__COMMON_CPU_H__

#include <cmath>
#include <cstddef>

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.

无关修改,请撤销



template <typename T>
__mlu_global__ void swigluKernel(T const *a_, T const *b_, T *c_, int *shape, int64_t *mlu_strides_a, int64_t *mlu_strides_b, int64_t *mlu_strides_c, int ndim){

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和ptrdiff_t吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants