Description
❓ Questions and Help
I am looking at a use case where metadata about a trained model's layers needs to be attached to the StableHLO export. I am using exported_program_to_stablehlo
One option I had considered is exporting the data completely separately from exported_program_to_stablehlo
(say, by writing some random json to disk), but then I don't know how to connect the written metadata back to the stableHLO export, because the layer names do not appear to be attached to the generated StableHLO ops such.
Another option I tried was to attach the metadata directly to the torch nodes before calling exported_program_to_stablehlo
, but I can't figure out how to do so in a way that results in the metadata being exported as MLIR attributes. It would suffice to export the attributes as, e.g., an op attribute with a given string name and value.
Could someone advise on whether this is possible, or suggest an alternative? (Or add a feature that would support this?)