Proposed 2.0 schema for AI/ML BOM - #948
Conversation
550769f to
d991431
Compare
|
Please note that the patterns found that begin with "^cdx:ai-ml:" can be further constrained to specific taxonomic categories in the referenced AI/ML v2.0 CycloneDX Property Tax. proposal PR (draft). This is included in the proposed schema and reflected in the corollary PR: CycloneDX/cyclonedx-property-taxonomy#175 |
|
@stevespringett Here is the "off-the-top-of-my-head" list of things that perhaps need thought around risk schema... Proposed updates the risk schema's "assessment" objectgoal: to be used for AI/ML or other types of assessments per regulatory requirements changes needed tot he "risk" schema's assessment object to address the needs for AI regulations (in these terms):
Currently, they are declared in "consideration": Promote measure (metrics) and type groupings to "common":Note: these include metrics for "enviromentalConsiderations" which have been candidates for move to "common" as well. Input/Output Formats and encodingsSimilarly, "format" and "encoding" objects and values are candidates for promotion to "common": |
|
@stevespringett added examples to all simple, non-nested schema type within the ai-ml schema file. |
…tch with json Signed-off-by: wievdndr <wiebe.vandendriessche@ugent.be>
Signed-off-by: wievdndr <wiebe.vandendriessche@ugent.be>
Signed-off-by: wievdndr <wiebe.vandendriessche@ugent.be>
…proto) Signed-off-by: wievdndr <wiebe.vandendriessche@ugent.be>
…roto files Signed-off-by: wievdndr <wiebe.vandendriessche@ugent.be>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Steve Springett <steve@springett.us>
Signed-off-by: Steve Springett <steve@springett.us>
Signed-off-by: Steve Springett <steve@springett.us>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Rebased on latest |
|
The proposed The schema's own image example illustrates the gap: {
"name": "image",
"format": {
"dataType": "uint8",
"encoding": "jpeg",
"mimeType": "image/jpeg"
},
"shape": [null, 3, 224, 224]
}As a reproducible example, I parsed the MobileNetV2 model contained in Google's hosted Archive SHA-256: TFLite member SHA-256: Google's LiteRT Interpreter API (
Using the LiteRT affine mapping
Therefore, identical In this TFLite case, these values are not merely narrative, author-supplied documentation. LiteRT documents that the converter populates the quantization parameters and stores them in the TFLite model file, where they are available through the Tensor API [2]. Reading these serialized artifact facts requires no inference run, runtime measurement, or heuristic reconstruction. The underlying numerical contract is not TFLite-specific. ONNX On the available extension points:
The property taxonomy already registers The corollary taxonomy PR (CycloneDX/cyclonedx-property-taxonomy#175) does not currently define a typed representation for tensor-level scales, zero-points, or quantization axes. Would an optional, framework-neutral affine-quantization object be in scope? {
"name": "image",
"quantization": {
"scheme": "affine",
"granularity": "per-tensor",
"scales": [0.0078125],
"zeroPoints": [128]
}
}Granularity is not binary. ONNX defines per-tensor, per-axis, and blocked quantization. An If this seems in scope, I would be happy to contribute a concrete schema change with aligned JSON, XML, and protobuf definitions, examples, and validation tests, either as a PR against this branch if that's the preferred route, or in whatever form is most useful. This proposal covers only the tensor's numerical representation. It does not claim to identify the full application preprocessing pipeline. [1] https://storage.googleapis.com/download.tensorflow.org/models/tflite_11_05_08/mobilenet_v2_1.0_224_quant.tgz |
I had not considered needing to describe quantization to that detail for the initial design as it was not called out by regulatory agencies (and esp. not affine quantization which I have not personally used in models I encounter within my company). I could see an argument that there might be some additional security/compliance features when matching models to runtimes/frameworks/harnesses/etc. to judge if there was some mismatch. Quant., again in general, might be some loose indicator of trust given loss of precision; however, benchmarks and such would be a better indicator (when provider per-quant.) of suitability of model given precision drop-off. In addition, the proposed addition assumes a single-file model; whereas, a single model repo. may have many quants. besides the full precision model; therefore, this information would need to be made available on a per-file basis and not simply a model repo. which would require some thought and refactoring as simply adding a single quantization schema would not suffice. I am curious going back to my first reaction... can you explain, in terms of model security and compliance and apart from my suppositions above, what having the quantization means for evaluating model risk? Again, we are not trying to "run" the model and perform operations on the tensor data... I am leaning towards perhaps allowing. such add. quantization info. being applied via additional property taxonomy values which would allow them to be applied on a per-file basis... additionally, I will give a hard look at why regulations are asking for overall "model inputs and outputs" with not much specificity and seems to be more about higher-order suitability of purpose. Would you agree we could use the property taxonomy to optionally annotate model files with these values? Here is an example of what I am thinking: Preserve the "macro" (Hyperparameter) value : cdx:ai-ml:model:hyperparameter:quantization = "Q4_K_M" for generalized model risk assessment. Then using "properties" for any possible technical serialization/runtime execution keys (i.e., any compiler/runtime optimizations) which can be applied on a per-parameter (tensor) basis on "modelParameter"; specifically, augmenting its "format": |
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
|
Yes, and thank you for sketching this out concretely. Provided that each model variant or file is represented as a separately hash-identified component, I agree that optional property-taxonomy annotations at the per-file, per-parameter level are an appropriate representation for these values. Keeping I also agree with your distinction between model suitability and configuration integrity. I am not proposing quantization as a general trust score or as a substitute for accuracy benchmarks. The narrower value is that a deployment system could compare the numerical contract declared by a harness with the contract recorded for a hash-identified model file, without running inference. Without that comparison, a contract mismatch does not surface at build or load time, since the tensor remains valid for its declared dtype and shape. I extracted 62 complete affine contracts from the external interfaces of 50 public TFLite files. The corpus ledger records the quantization scheme and granularity, together with the scale and zero-point values. Mapped to the proposed property taxonomy, these correspond to All 62 observed external contracts were per-tensor: each contained one scale and one zero-point. Their serialized TFLite For future per-axis support, an One detail in the worked example may be worth checking. If it is intended to describe the same Google-hosted MobileNetV2 artifact cited above, that artifact exposes an NHWC input shape of I am less certain that For context, I also ran a paired experiment on a deterministic 1,000-image ImageNetV2 subset. For each target model, the artifact, images, resize and crop procedure, and runtime were fixed while only the affine input encoder was replaced with the other model's contract. EfficientNet-Lite0 changed from 59.3% to 50.1% top-1 accuracy (two-sided exact McNemar p = 5.5e-14), while MobileNetV2 changed from 58.1% to 56.8% and was not statistically significant (p = 0.182). This is not a prevalence estimate; it demonstrates that a structurally valid contract mismatch can produce a material accuracy change for one target artifact while remaining statistically non-significant for another. The corpus, artifact hashes, interface ledgers, per-image predictions, and verification scripts are available here: For context on where my interest comes from: my work is in medical device software, where small numerical differences can matter more than they would elsewhere, and where a change you cannot see is harder to manage than one you can. That is my own vantage point rather than a general argument, and I would not want the case to rest on it. SBOM and ML-BOM have been genuinely useful to me in that setting, and I am aware I am arriving late to work you have already carried a long way. I would be glad to help draft the taxonomy entries and worked examples for full-precision and per-tensor affine files, and to help define a canonical per-axis representation, following whichever contribution format is most useful for CycloneDX/cyclonedx-property-taxonomy#175. |
Note: I rebased from "2.0-dev" and then manually brought in schemas from "2.0-threadmodeling" and also from "2.0-blueprints" and this PR is against master...
The only files that matter (if other branches are merged) are:
Plus, want to delete the 1.7 port of: