Archived
builder: narrow an f32 source to a bf16 declaration at load
The builder accepted one conversion direction beyond the exact widening it already did: a single-plane RAD_F32 source declared RAD_BF16 is rounded to nearest even at load (WeightInfo::narrow, beside widen). It is staged like a widened weight, never read in place from the container, and the planner and oracle treat it as 'not the container's stored bytes'. build_test covers the declaration, the stored dtype and size, and that it is not file-direct.
This commit is contained in:
1 parent
fd40bb430c
commit
6c33ee4e12
6 files changed
+79
-32
No files matched your search
+5
-2
@@ -189,11 +189,13 @@ struct WeightInfo {
|
||||
/* Filled by the layout pass: what the resolved kernel stores. `identity` is the selected
|
||||
* plane's bytes unchanged, the only form the file and mapped tiers can serve since they read
|
||||
* the container in place; `widen` is identity plus an exact widening (a bf16 norm read as
|
||||
* f32) done by the loader. Otherwise the kernel at (lay_op, lay_band, lay_dom) relayouts it at
|
||||
* f32) done by the loader, and `narrow` an exact narrowing (an f32 readout head served as
|
||||
* bf16). Otherwise the kernel at (lay_op, lay_band, lay_dom) relayouts it at
|
||||
* load, as operand `lay_operand`. */
|
||||
std::string layout_tag;
|
||||
bool identity = true;
|
||||
bool widen = false;
|
||||
bool narrow = false;
|
||||
int32_t lay_op = -1, lay_band = -1, lay_dom = -1, lay_operand = -1;
|
||||
uint32_t stored_dtype = RAD_DT_INVALID;
|
||||
uint32_t stored_rank = 0;
|
||||
@@ -238,7 +240,8 @@ inline void weight_planes(const WeightInfo& w, RadTensor* t) {
|
||||
* the mapped tier's pointer): only when they are the selected plane unchanged and this rank holds
|
||||
* all of it. A relayout is not in the file, and a column shard is not one contiguous range. */
|
||||
inline bool weight_file_direct(const WeightInfo& w, int world_size) {
|
||||
return w.identity && !w.widen && (w.decl.shard == RAD_SHARD_NONE || world_size <= 1);
|
||||
return w.identity && !w.widen && !w.narrow &&
|
||||
(w.decl.shard == RAD_SHARD_NONE || world_size <= 1);
|
||||
}
|
||||
|
||||
struct BufferInfo {
|
||||
|
||||
Reference in new issue
Block a user