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

Improve propagation passes docstrings #276

Closed
wants to merge 5 commits into from

Conversation

melissawm
Copy link
Contributor

  • Remove some comments to outside the rendered docs;
  • Rewrite options using the Options<> syntax;
  • Corrects typos and suggest some wording.

Comment on lines 59 to 83
let options = [
Option<"keepShardingRules", "keep-sharding-rules", "bool",
/*default=*/"false",
"whether to keep existing and created op sharding rules.">,
Option<"moduleDumpDirectory", "module-dump-directory", "string",
/*default=*/"",
"where to dump any rewritten modules for debugging.">,
Option<"conservativePropagation", "conservative-propagation", "bool",
/*default=*/"false",
"whether to disallow split axes and non-divisible sharding axes during "
"propagation.">,
Option<"debugShardingOrigins", "debug-sharding-origins", "bool",
/*default=*/"false",
"whether to save information about the origin of a sharding on the MLIR "
"module. These would be the shardings on the function inputs, outputs, "
"sharding constraints and manual computations before propagation.">,
Option<"debugEdgeSourceSharding", "debug-edge-source-sharding", "bool",
/*default=*/"false",
"whether to save information about the edge source of a sharding on the "
"MLIR module. These are what operand/result introduced a sharding on "
"some op result.">,
Option<"propagationStrategy", "propagation-strategy", "string",
/*default=*/"",
"which factor propagation strategy to use.">,
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I'm surprised this works! I remember due to the subclassing we couldn't make these explicit options. Does this compile and all tests pass? I'm guessing it does since the flags are duplicated?

I guess an annoying issue is that we can't create top level constants which save these options in a list, and have to duplicate them. Hmm I'm unsure what is better to do here....I'm leaning to keeping it as is, @tomnatan30 any thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this doesn't work, see failing build.

We can't declare the options at the moment because we define them in the c++ files so they can be inherited.

@melissawm feel free to update the description of the options and change their format so they will look better in the auto generated doc, but we can't switch to declarative options just yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try to make it look exactly as it does with the declarative options you have now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pity! Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think repeating is fine - in terms of usability, having all options on hand when looking up one of these items is more helpful than having to click through other previously defined items. In addition, the items on the page are now shown in the same order as the source file so we can't rely on what was "previously" defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I understand the concern. It's up to you really - I'm happy to move that back and refer to the original options instead of repeating. Just let me know and I'll change it 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would want to try declaring the options like you did before, and this was require some refactoring, so better to keep it simple until we do (not repeating) if that's ok.

btw, when we use the let options, the auto generated doc would have:

Options

-some-option1 : whether to do A
-some-option2 : whether to do B

Should we reuse this format or keep as is? Maybe better to avoid the #### Options, given it looks out of format in the td file. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the difference - the #### are added automatically when the let options syntax is used, so I'm not sure that could be tweaked. I could use that in the description field but I think it would look out of place, as the markdown section hierarchy represented by the # characters would be lost. I would vote for just using bold face for now (as in **Options**)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also referring to the code block all options were in when using the let options syntax, but lets keep as is :)

The PR got auto imported with the previous version (with duplication), and this PR was automatically closed. This is fine, we can fix it on out side.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry about that! Let me know if there's anything I can do, otherwise thanks for all the feedback!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants