Skip to content

feat(vpto): extend fp8 packed ldg stg to x4/x8#987

Open
and0d0 wants to merge 3 commits into
hw-native-sys:mainfrom
and0d0:489-fp8-ext
Open

feat(vpto): extend fp8 packed ldg stg to x4/x8#987
and0d0 wants to merge 3 commits into
hw-native-sys:mainfrom
and0d0:489-fp8-ext

Conversation

@and0d0

@and0d0 and0d0 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

基于#897
扩展的 #917 提到的 fp8 packed store(fp8x2, fp8x4, fp8x8)
ldg/stg:

vector<2xf8E4M3FN>
vector<2xf8E5M2>
!pto.hif8x2
增加
vector<4xf8E4M3FN>
vector<4xf8E5M2>
vector<8xf8E4M3FN>
vector<8xf8E5M2>

Comment thread ptodsl/ptodsl/_ops.py Outdated
buffer_value, index_value = resolve_address_access(ptr_or_ref, offset)
elem_type = _pointer_element_type(buffer_value, context="stg(value, ptr, offset)")
raw_value = unwrap_surface_value(value)
if raw_value.type == elem_type:

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.

使用unwrap_surface_value,raw_value是否可能没有type这个属性?需不需要加个判断保护

module attributes {pto.target_arch = "a5", pto.kernel_kind = #pto.kernel_kind<vector>} {
func.func @packed_vector_ldst_kernel(
%gm_f8e4: !pto.ptr<vector<2xf8E4M3FN>, gm>,
%gm_f8e4x4: !pto.ptr<vector<4xf8E4M3FN>, gm>,

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.

这里加了测试行没加CHECK

return
}
// vector<4xf32> has dim size 4 — rejected (only dim size 2 is supported).
// vector<4xf32> has dim size 4 — rejected (only fp8 supports 4/8 lanes).

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.

扩展后出现了新的应拒类型组合(如 vector<16xf8E4M3FN>、vector<4xf16>、vector<4xi16>、vector<8xi8>),没有任何负例锁定验证器的 lanes 白名单行为

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants