Skip to content

Enhance WITH statement attributes parse for each submitter #774

@typhoonzero

Description

@typhoonzero

We should have a common function call to validate attributes for different submitters to use:

func ValidateAttributes(definition map[string]*AttrMeta, ir *IR) (map[string]*attribute, error)

AttrMeta is a struct defines the type and documents for the attribute:

struct AttrMeta {
    typ AttrType, // can be INT, STRING, LIST
    doc string,
}

The definition is a mapping to define supported attributes for current submitter. e.g. for tensorflow submitter:

{
    "train.epochs": &AttrMeta{AttrTypeInt, "number of epochs to train"},
    "model.optimizer": &AttrMeta{AttrTypeString, "the name of optimizer to use"}
}

the submitter's codegen should call ValidateAttributes to validate attributes In the IR. And the document of the model using current codegen will be auto-generated.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions