Skip to content

Proto data dependent symbolics#5077

Draft
CharlieL7 wants to merge 3 commits into
sym_slicefrom
proto_data_dependent_symbolics
Draft

Proto data dependent symbolics#5077
CharlieL7 wants to merge 3 commits into
sym_slicefrom
proto_data_dependent_symbolics

Conversation

@CharlieL7

Copy link
Copy Markdown
Collaborator

Motivation

  • Prototype of framework to handle data-dependent symbolic variables.

Technical Details

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

@CharlieL7
CharlieL7 requested a review from shivadbhavsar July 17, 2026 21:45
@CharlieL7 CharlieL7 self-assigned this Jul 17, 2026
return inputs.at(0);
}

//TODO: have a function that tells how to link up the symbols to the inputs? Or keep it a simple 1 to 1?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
//TODO: have a function that tells how to link up the symbols to the inputs? Or keep it a simple 1 to 1?
// TODO: have a function that tells how to link up the symbols to the inputs? Or keep it a
// simple 1 to 1?

Comment on lines +70 to +73
argument compute(shape, std::vector<argument> args) const
{
return args[0];
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
argument compute(shape, std::vector<argument> args) const
{
return args[0];
}
argument compute(shape, std::vector<argument> args) const { return args[0]; }

* slice(input, ends, axes); starts set
* slice(input, start, ends, axes); none set
* `mode` specifies what the inputs to slice are:
* one_input: slice(input);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
* one_input: slice(input);
* one_input: slice(input);

Comment on lines +69 to +79
MIGRAPHX_NESTED_ENUM_CLASS(
slice_mode,
one_input,
starts_input,
ends_input,
axes_input,
starts_ends_input,
starts_axes_input,
ends_axes_input,
starts_ends_axes_input
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
MIGRAPHX_NESTED_ENUM_CLASS(
slice_mode,
one_input,
starts_input,
ends_input,
axes_input,
starts_ends_input,
starts_axes_input,
ends_axes_input,
starts_ends_axes_input
);
MIGRAPHX_NESTED_ENUM_CLASS(slice_mode,
one_input,
starts_input,
ends_input,
axes_input,
starts_ends_input,
starts_axes_input,
ends_axes_input,
starts_ends_axes_input);

static auto reflect(Self& self, F f)
{
return pack(f(self.axes, "axes"), f(self.starts, "starts"), f(self.ends, "ends"));
return pack(f(self.axes, "axes"), f(self.starts, "starts"), f(self.ends, "ends"), f(self.mode, "mode"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
return pack(f(self.axes, "axes"), f(self.starts, "starts"), f(self.ends, "ends"), f(self.mode, "mode"));
return pack(f(self.axes, "axes"),
f(self.starts, "starts"),
f(self.ends, "ends"),
f(self.mode, "mode"));

Comment on lines +50 to +57
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);
auto ret =
mm->add_instruction(migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Comment on lines +49 to +56
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);
auto ret =
mm->add_instruction(migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Comment on lines +49 to +56
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);
auto ret =
mm->add_instruction(migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Comment on lines +55 to +62
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
auto ret = mm->add_instruction(
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);
auto ret =
mm->add_instruction(migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Comment on lines 46 to +53
return mm->add_instruction(
migraphx::make_op("slice", {{"axes", {0}}, {"starts", {0}}}), idx, cnt);
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
return mm->add_instruction(
migraphx::make_op("slice", {{"axes", {0}}, {"starts", {0}}}), idx, cnt);
migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);
return mm->add_instruction(migraphx::make_op("slice",
{{"axes", {0}},
{"starts", {0}},
{"ends", {migraphx::to_value(num_selected_var)}},
{"mode", "ends_input"}}),
idx,
bind);

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.

1 participant