Inspect DistilBERT delegation with Model Explorer
Use the same Model Explorer setup from the GPT-2 section.
Run the following on your development machine with the PTE adapter enabled:
model-explorer \
--port 8081 \
--extensions=pte_adapter_model_explorer
When you are finished, press Ctrl+C in the Model Explorer terminal to stop the local server.
In the browser UI, select these three files from your machine and open them:
module-1-transformer-inference-with-xnnpack/artifacts/distilbert/distilbert_fillmask_exported.pt2module-1-transformer-inference-with-xnnpack/artifacts/distilbert/distilbert_fillmask_portable.ptemodule-1-transformer-inference-with-xnnpack/artifacts/distilbert/distilbert_fillmask_xnnpack.pte
Compare the three graphs, primarily looking at the portable and ExecuTorch with XNNPACK .pte graphs. Look at the same areas as before, and consider the following questions:
- Does the DistilBERT XNNPACK graph have fewer and/or larger delegate regions than GPT-2?
- Does it look more or less fragmented than GPT-2?
- Which operators still fall back to the default ExecuTorch path?
- Are normalization, reshape, mask-position, or elementwise operations creating boundaries?
Remember that a smaller number of delegate regions can be better if they capture the expensive work. A larger number can still be useful if the regions contain the main matrix operations. Use the graph shape, fallback list, and benchmark results together.
You are now ready to start benchmarking on the Raspberry Pi.
Course complete
Nice work
You completed Optimize and deploy AI inference with ExecuTorch on Arm.