Archived
libr4d: a fill op
y = value over an [M, n] extent at a row pitch, bf16, default 0. The op a rank issues where it has nothing to compute and a reader downstream -- an all-reduce, a residual -- still expects a defined buffer: a wire shared across layers cannot be zeroed once a step, and a memset knows neither the pitch nor the dtype. Smoke-tested for the exact zero, the pitch, and the RNE of a value.
This commit is contained in:
1 parent
fd54038b8c
commit
cd48c61daf
6 files changed
+115
No files matched your search
@@ -528,6 +528,14 @@ extern "C" int r4d_shape_binary(const RadParam* p, int n_p, int operand,
|
||||
R4D_PICK(l);
|
||||
}
|
||||
|
||||
extern "C" int r4d_shape_fill(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
|
||||
const int64_t M = pi(p, n_p, "M");
|
||||
const int64_t n = pi(p, n_p, "n");
|
||||
const uint32_t D = dt_act(p, n_p, "dtype");
|
||||
const RadOpdDesc l[] = { opd(D, M, n) };
|
||||
R4D_PICK(l);
|
||||
}
|
||||
|
||||
extern "C" int r4d_shape_unary(const RadParam* p, int n_p, int operand,
|
||||
RadOpdDesc* out) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user