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

slicing passmanagers #3195

Closed
ajavadia opened this issue Oct 4, 2019 · 5 comments
Closed

slicing passmanagers #3195

ajavadia opened this issue Oct 4, 2019 · 5 comments
Assignees
Labels
good first issue Good for newcomers status: pending PR It has one or more PRs pending to solve this issue

Comments

@ajavadia
Copy link
Member

ajavadia commented Oct 4, 2019

following #3004, implement methods to slice PassManagers to only get a subset of passes:

pm = PassManager(...)

pm[1]
pm[1:3]

pm1[1:3] + pm2[4:6]  # be able to concatenate several passmanagers
pm_level1[:8] + pm_3rdparty[0] + pm_level1[9:]
@ajavadia ajavadia added the good first issue Good for newcomers label Oct 4, 2019
@faisaldebouni
Copy link
Contributor

I'm trying to implement this. However I need some guidance:
pm[..] should return a PassManager with subset of passes (rather than the subset of passes it self) correct?
because this way it would allow to carry conditions, options .. etc
also it will allow something like
pm[0:3].draw()
it will also allow
pm[..] + pm[..]
and
pm + pm[..]
to act in similar way.

the only downside would be that this won't work:
pm1[3] = pm2[1]

@1ucian0
Copy link
Member

1ucian0 commented Oct 6, 2019

pm[..] should return a PassManager with subset of passes (rather than the subset of passes it self) correct?

Yes. It should. Currently, a PassManager does not fully emulate a container type. And I think it should though. A PassManager is a collection of pass sets (FlowController instances) that are saved in working_list list. That's the list that is important here.

"Wrap" the working_list. Let me know if that makes sense. We can discuss it with code.

@1ucian0 1ucian0 self-assigned this Oct 6, 2019
@faisaldebouni
Copy link
Contributor

That makes perfect sense. Thanks. Will report once I finish.

@1ucian0
Copy link
Member

1ucian0 commented Oct 23, 2019

pending PR in #3209

@1ucian0 1ucian0 added the status: pending PR It has one or more PRs pending to solve this issue label Oct 23, 2019
@1ucian0
Copy link
Member

1ucian0 commented Nov 5, 2019

closed via #3209

@1ucian0 1ucian0 closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers status: pending PR It has one or more PRs pending to solve this issue
Projects
None yet
Development

No branches or pull requests

3 participants