Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for consuming instruction annotations to TokenGraphBuilderModels. #94

Merged
merged 14 commits into from
Jul 22, 2024

Commits on Mar 26, 2024

  1. Add instruction annotation message to proto specification.

     * Add new message type `AnnotationProto`
       (`gematria/proto/annotation.proto`).
     * Include it `CanonicalizedInstructionProto`.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    fe0b7f3 View commit details
    Browse the repository at this point in the history
  2. Add instruction annotation support to basic block representation.

     * Add new `Annotation` class.
     * Add `instruction_annotations` vector to `Instruction`.
     * Add Python bindings for these.
     * Add tests for all above changes.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    63a914f View commit details
    Browse the repository at this point in the history
  3. Add conversions between Annotation and AnnotationProto and back.

     * Add `Annotation` conversion and update `Instruction` conversion.
     * Refactor `ToVector` and `ToRepeatedPtrField` to be generic.
     * Add Python bindings for conversions.
     * Add tests for all changes.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    aafb571 View commit details
    Browse the repository at this point in the history
  4. Store instruction annotations while building graph.

     * Make instruction annotations available to models via the graph
       builder, where they are stored as a vector-of-vector matrix.
     * Add Python bindings for the same.
     * Add tests for the C++ graph builder implementation, and update the
       tests for the Python bindings to be compatible with the changes.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    160e854 View commit details
    Browse the repository at this point in the history
  5. Add test for graph builder instruction annotation Python bindings.

     * Add a test adding basic blocks with annotations to the graph builder.
     * Add `annotated_basic_blocks_with_throughput.pbtxt` as a source for
       annotated basic blocks for tests.
     * Add utilities to get the annotated blocks to `gematria/testing`.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    1c9e599 View commit details
    Browse the repository at this point in the history
  6. Incorporate instruction annotations in node embedding computation.

     * The ends of node embedding vectors used by `TokenGraphBuilderModel`s
       for instructions are overwritten by the corresponding instruction
       annotations.
     * A test for `TokenGraphBuilderModel`s consuming instruction
       annotations has been added as well.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    8527839 View commit details
    Browse the repository at this point in the history
  7. Add command-line support for running models consuming annotations.

     * Add a `--gematria_annotation_names_file` flag to `run_granite_model`
       to pass in a list of instruction annotation names consumed by the
       model.
    virajbshah committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    a7c333e View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Make suggested changes.

    virajbshah committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    c3c95aa View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Fix nits.

    virajbshah committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    13f4db9 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2024

  1. Address reviewer comments.

     * Move annotation-related tensors from `TokenGraphBuilderModel` to
       `GraphBuilderModelBase`.
     * Adjust the order in which annotation-related tensors are created
       relative to other parts of the graph.
     * Refactor `TokenGraphBuilderModelNodeEmbed`.
    virajbshah committed Jun 21, 2024
    Configuration menu
    Copy the full SHA
    29a5c11 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Minor refactoring.

    virajbshah committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    ff2fcf5 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Configuration menu
    Copy the full SHA
    58eab6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0fe7a7f View commit details
    Browse the repository at this point in the history
  3. Temporarily pin TensorFlow version to 2.15

     * TF 2.15 is the last version to support Keras 2 without any fixes.
     * Until google#132 lands with a fix that lets us keep using Keras 2,
       this pins the TF version to 2.15 for CI.
     * After this lands, google#132 can be updated to also patch the Keras 2
       usage in this PR and then we can bump the TF version up.
    virajbshah committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    f4b0da1 View commit details
    Browse the repository at this point in the history