google / gematria

Machine learning for machine code.
Apache License 2.0
68 stars 11 forks source link

GRANITE Performance model with context #196

Open ondrasej opened 1 week ago

ondrasej commented 1 week ago

As of now, the GRANITE model is basic-block oriented (resp. trace-oriented), i.e. it doesn't use any information about code that was executed before or after the basic block. We believe that adding such information may provide additional context to improve the prediction of the precisions.

The GRANITE model can be extended to cover such context by:

  1. adding code graph from the preceding basic block (in execution order) and the following basic block,
  2. modifying the predictor to compute throughput only from the instructions in the input basic block.

This modification will also require an extension to the data collection methodology to collect basic blocks and their throughput with the execution context.

boomanaiden154 commented 1 week ago

For potential pretraining, we could use existing reciprocal throughput measurements as we know that the context is just the block itself up to whatever reasonable context limits we have.