// Copyright © Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT include "data_types.fbs"; include "tensor_attributes.fbs"; include "batchnorm_attributes.fbs"; include "batchnorm_backward_attributes.fbs"; include "batchnorm_inference_attributes.fbs"; include "batchnorm_inference_attributes_variance_ext.fbs"; include "convolution_fwd_attributes.fbs"; include "convolution_bwd_attributes.fbs"; include "convolution_wrw_attributes.fbs"; include "layernorm_attributes.fbs"; include "layernorm_backward_attributes.fbs"; include "matmul_attributes.fbs"; include "pointwise_attributes.fbs"; include "rmsnorm_attributes.fbs"; include "rmsnorm_backward_attributes.fbs"; include "block_scale_dequantize_attributes.fbs"; include "block_scale_quantize_attributes.fbs"; include "sdpa_attributes.fbs"; include "sdpa_backward_attributes.fbs"; include "custom_op_attributes.fbs"; include "reduction_attributes.fbs"; include "resample_fwd_attributes.fbs"; namespace hipdnn_flatbuffers_sdk.data_objects; union NodeAttributes { BatchnormInferenceAttributes, PointwiseAttributes, BatchnormBackwardAttributes, BatchnormAttributes, ConvolutionFwdAttributes, ConvolutionBwdAttributes, ConvolutionWrwAttributes, BatchnormInferenceAttributesVarianceExt, MatmulAttributes, RMSNormAttributes, LayernormAttributes, SdpaAttributes, BlockScaleDequantizeAttributes, BlockScaleQuantizeAttributes, SdpaBackwardAttributes, CustomOpAttributes, RMSNormBackwardAttributes, ReductionAttributes, ResampleFwdAttributes, LayernormBackwardAttributes } table Node { name: string; compute_data_type: DataType; attributes: NodeAttributes; } // Semantic version (MAJOR.MINOR.PATCH) of the engine plugin API this graph // requires. Mirrors hipdnn_plugin_sdk::hipdnn_data_sdk::utilities::Version. // Stamped by GraphDescriptor::buildGraphFromOperations() from the same // computeMinimumEnginePluginApiVersion() used by EnginePluginResourceManager's // applicability filter, so both the deserialize-time reader guard and the // plugin-version floor derive from a single source of truth. struct EngineApiVersion { major: uint; minor: uint; patch: uint; } // Hipdnn expects that the serialized graph is sorted in topological order, has no cycles, // and is fully connected (no orphan nodes). Additionally, all tensors in the graph must have unique uids. table Graph { name: string; compute_data_type: DataType; intermediate_data_type: DataType; io_data_type: DataType; tensors: [TensorAttributes]; nodes: [Node]; preferred_engine_id: long = null; // Graph-level opt-in for execute-time override shapes. is_override_shape_enabled: bool = false; // Minimum engine plugin API version required to execute this graph (RFC 0016 §4.2). // Absent on graphs a writer didn't stamp (e.g. hand-built fixtures, JSON-sourced // graphs) -- callers must treat a missing field as the baseline "1.0.0" floor, // exactly like the field's absence used to mean min_reader_version == 0. min_required_engine_api_version: EngineApiVersion; } root_type Graph;