What
A Core ML llama export that asks for an etrecord gets no file and no warning.
_to_edge_and_lower_llama_coreml sets the etrecord flag on the builder, but nothing afterwards asks
the program manager for the record or saves it, and the save step writes the model file and stops.
Measured on the same tiny model, changing only which lowering arm runs, with
debug.generate_etrecord true:
| arm |
files produced |
| generic |
['etrecord.bin', 'llama3.pte'] |
| Core ML |
['llama3.pte'] |
No file, no warning. It also still pays for a copy.deepcopy of the whole edge program, which is
then dropped (exir/_program.py attaches the record via deepcopy).
The path Core ML took before #21969 wrote the file, so for anyone using that flag this is a step
back rather than a pre-existing gap.
Related
_to_edge_and_lower_llama_xnnpack has the same gap with a TODO next to it. Worth copying that TODO
onto the Core ML helper so the next reader sees it, whichever way this is fixed.
Caveat on my measurement: the Core ML run substituted an XNNPACK partitioner, since real Core ML
lowering needs macOS. The etrecord plumbing exercised is the real one, but the Core ML backend was
not.
Found while reviewing #22298.
What
A Core ML llama export that asks for an etrecord gets no file and no warning.
_to_edge_and_lower_llama_coremlsets the etrecord flag on the builder, but nothing afterwards asksthe program manager for the record or saves it, and the save step writes the model file and stops.
Measured on the same tiny model, changing only which lowering arm runs, with
debug.generate_etrecordtrue:['etrecord.bin', 'llama3.pte']['llama3.pte']No file, no warning. It also still pays for a
copy.deepcopyof the whole edge program, which isthen dropped (
exir/_program.pyattaches the record via deepcopy).The path Core ML took before #21969 wrote the file, so for anyone using that flag this is a step
back rather than a pre-existing gap.
Related
_to_edge_and_lower_llama_xnnpackhas the same gap with a TODO next to it. Worth copying that TODOonto the Core ML helper so the next reader sees it, whichever way this is fixed.
Caveat on my measurement: the Core ML run substituted an XNNPACK partitioner, since real Core ML
lowering needs macOS. The etrecord plumbing exercised is the real one, but the Core ML backend was
not.
Found while reviewing #22298.