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
[fx] Add pofo solver #1608
[fx] Add pofo solver #1608
Conversation
Merge ColossalAI
Daily merge
class PofoSolver: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should include a docstring here. You can move your PR description here so that it will appear on our API documentation.
from colossalai.fx.profiler import parameter_size | ||
import math | ||
from .linearize import linearize | ||
from .utils import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use *
.
def _discretize(mem_unit, values): | ||
return [math.ceil(value / mem_unit) for value in values] | ||
|
||
|
||
class Chain: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These classes in the utils
file are not really utils
, they are more like to be in a file like operation.py
or action.py
.
…/ColossalAI into feature/add_ckpt_offload_solver
What's New?
The new pofo solver is based on paper Efficient Combination of Rematerialization and Offloading for Training DNNs and it's code given in the supplemental. Currently we doesn't use the whole set up in the original paper and reuse rotor solver for the backward sequence as suggested in supplemental. The solver now is able to find strategy with offload. I will redesign the codegen later and add graph annotation to this solver when the codegen is compatible.