Skip to content

Add pfnGetArgumentProperties4 with 8D dims support and refactored argument properties struct - #57

Open
jburcham-intel wants to merge 2 commits into
mainfrom
tensor_dimensions
Open

Add pfnGetArgumentProperties4 with 8D dims support and refactored argument properties struct#57
jburcham-intel wants to merge 2 commits into
mainfrom
tensor_dimensions

Conversation

@jburcham-intel

Copy link
Copy Markdown
Contributor

Summary

Adds a new graph argument properties query (ze_graph_argument_properties_4_t / pfnGetArgumentProperties4, extension v1.20) to support tensors with rank up to 8 (ZE_MAX_GRAPH_ARGUMENT_DIMENSIONS_SIZE_8), replacing the 5D cap in v3. Rather than just widening the existing struct, this cleans up accumulated redundancy/dead weight from v1-v3:

  • networkPrecision/devicePrecision and networkLayout/deviceLayout collapse into single precision/layout fields reporting the compiled argument's properties — what callers actually need to allocate and bind buffers correctly.
  • quantReverseScale/quantZeroPoint (added in v2, never consumed) are removed.
  • The embedded associated_tensor_names array (char[32][256], ~8KB per query result) is removed from the struct entirely. A new pfnGetArgumentAssociatedTensorNames query replaces it, using the same query-size-then-fetch pattern already used by pfnGetNativeBinary / pfnGraphBuildLogGetString / pfnQueryNetworkGetSupportedLayers — no arbitrary name-count/length cap, and zero cost for the common case of an argument with no associated names.

Also adds ze_graph_argument_value_strides_2_t (new stype ZE_STRUCTURE_TYPE_GRAPH_ARGUMENT_STRIDES_2), an 8D-capable variant of ze_graph_argument_value_strides_t passed through the existing pfnSetArgumentValue2's pArgValue parameter, disambiguated by stype. This keeps the 8D story symmetric between reading argument properties and setting per-argument strides, without changing the layout of the existing 5D struct in place (widening a trailing array under a shared stype would be an unsafe ABI break for any driver/plugin version skew).

Changes

  • Bump ZE_GRAPH_EXT_VERSION_CURRENT to 1.20; backfill missing ddi-table version placeholder comments for 1.17-1.19.
  • New: ZE_MAX_GRAPH_ARGUMENT_DIMENSIONS_SIZE_8, ze_graph_argument_properties_4_t, pfnGetArgumentProperties4, pfnGetArgumentAssociatedTensorNames, ze_graph_argument_value_strides_2_t.
  • New stypes: ZE_STRUCTURE_TYPE_GRAPH_ARGUMENT_PROPERTIES_4 (0x12), ZE_STRUCTURE_TYPE_GRAPH_ARGUMENT_STRIDES_2 (0x13).
  • Clarified the pfnSetArgumentValue/pfnSetArgumentValue2 pArgValue doc comment to name each accepted struct type explicitly.
  • Header-only change; no other files in this repo reference these types.

Comment thread ze_graph_ext.h
Comment thread ze_graph_ext.h Outdated
Comment thread ze_graph_ext.h Outdated
Comment thread ze_graph_ext.h Outdated
Comment thread ze_graph_ext.h
///< tensor names associated with this argument
ze_graph_argument_name_type_t nameType, ///< [in] type of the argument name to query
size_t* pSize, ///< [in,out] size of pNames buffer in bytes
char* pNames ///< [in,out][optional] null-terminated name(s) associated with this argument

@lmielick lmielick Sep 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a pre-mature optimization, but it might make sense to also return number of names in the buffer, so the caller can reserve a vector or query the number of strings with pNames = NULL.

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.

5 participants