Skip to content

Consider adding FrontendAttributesAttr and BackendConfigAttr #628

Open

Description

@burmako

Found during the #565 audit in hlo_instruction.cc.

  if (proto.has_frontend_attributes()) {
    instruction->set_frontend_attributes(proto.frontend_attributes());
  }

  // Generic map of attributes used to pass hints / configuration options from
  // the Python frontend to the XLA backend.
  message FrontendAttributes {
    map<string, string> map = 1;
  }
  instruction->backend_config_ = proto.backend_config();

  // Backend configuration for the instruction. Has backend-specific meaning.
  bytes backend_config = 43;

These are some powerful extensibility mechanisms, but it is not immediately obvious that we want extensibility in StableHLO to look like this. Features that allow attaching arbitrary strings to arbitrary ops conflict with StableHLO's focus on crystal clear semantics and strong compatibility guarantees, so this will need a dedicated discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions