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

Move vectorized domains innermost always #2464

Open
naoyam opened this issue Feb 15, 2023 · 0 comments
Open

Move vectorized domains innermost always #2464

naoyam opened this issue Feb 15, 2023 · 0 comments
Assignees

Comments

@naoyam
Copy link
Collaborator

naoyam commented Feb 15, 2023

// In the case of outer grid persistence, make sure the vectorized
// domain placed at the innermost position.
// TODO: Why isn't this the case by default?
if (is_outer_grid_persistence) {
int vec_id_cur_pos = -1;
std::unordered_map<int, int> vec_reorder_map;
for (const auto i : c10::irange(reduction_rf_tv->nDims())) {
auto id = reduction_rf_tv->axis(i);
if (id->getParallelType() == ParallelType::Vectorize) {
vec_id_cur_pos = i;
vec_reorder_map[i] = -1;
} else if (vec_id_cur_pos >= 0) {
vec_reorder_map[i] = i - 1;
}
}
TORCH_INTERNAL_ASSERT(vec_id_cur_pos != -1, "Vectorized ID not found");
reduction_rf_tv->reorder(vec_reorder_map);
}

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 a pull request may close this issue.

1 participant