Feature Architecture#
AI-Platform Architecture
|
status: draft
security: NO
safety: ASIL_B
|
||||
AI-Platform
|
status: valid
security: NO
safety: ASIL_B
|
||||
Interfaces#
Inference
The inference interface is the application-facing entry point of the AI Platform. It is intentionally narrow: it exposes the common denominator of the supported backends and omits vendor-specific options, accelerator selection and memory placement, which remain platform-internal.
Inference Interface
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||
load
|
status: valid
security: NO
safety: ASIL_B
|
||||
Resolves a model by identity and version constraint and returns a model handle. Input and output descriptors are fixed once the model is loaded. |
|||||
describe
|
status: valid
security: NO
safety: ASIL_B
|
||||
Returns the input and output descriptors of a loaded model, consisting of name, data type, shape and layout. |
|||||
invoke
|
status: valid
security: NO
safety: ASIL_B
|
||||
Executes a loaded model synchronously within a given deadline. Exceeding the deadline is reported as an error instead of blocking the caller indefinitely. |
|||||
invoke_async
|
status: valid
security: NO
safety: ASIL_B
|
||||
Starts an execution and returns a handle that allows waiting for completion. |
|||||
cancel
|
status: valid
security: NO
safety: ASIL_B
|
||||
Requests termination of a pending asynchronous execution and releases its resources. |
|||||
unload
|
status: valid
security: NO
safety: ASIL_B
|
||||
Releases a model handle and the resources associated with it. |
|||||
Interface Sketch#
The following sketch illustrates the interface from an application perspective. It is illustrative and does not fix the final signatures.
namespace score::ai {
// Describes one input or output of a model. Shapes are fixed after Load.
struct TensorDesc {
std::string_view name;
DataType type; // e.g. Float32, Float16, Int8, UInt8
std::span<const int64_t> shape;
Layout layout; // e.g. NCHW, NHWC, Linear
};
// Opaque handle to a platform-managed buffer. Allows zero-copy for data that
// already resides in accelerator memory (e.g. camera output).
class Buffer;
class Model {
public:
std::span<const TensorDesc> Inputs() const;
std::span<const TensorDesc> Outputs() const;
Result<void> Invoke(std::span<const Buffer> inputs,
std::span<Buffer> outputs,
Deadline deadline);
Result<Execution> InvokeAsync(std::span<const Buffer> inputs,
std::span<Buffer> outputs,
Deadline deadline);
};
// Resolves a model by identity and version constraint; the platform selects the
// backend and the accelerator.
Result<Model> Load(ModelId id, VersionConstraint constraint);
} // namespace score::ai
Properties implied by this interface:
Identity instead of paths: applications reference a model by identity and version constraint, so model artifacts can be updated, signed and rolled back without changing the application.
Fixed shapes after load: descriptors are known after loading, which allows buffer allocation and timing analysis before the first execution.
Explicit deadlines: every execution carries a deadline, so a missed deadline is a defined, reportable error.
Buffer handles instead of pointers: data may stay in accelerator memory, which keeps zero-copy paths possible without exposing the memory model to the application.
No backend in the signature: the selected runtime (e.g. ONNX Runtime, TensorRT, QNN) is a deployment decision and does not appear in application code.