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

[fx] Add pofo solver #1608

Merged
merged 38 commits into from Sep 20, 2022

Conversation

Cypher30
Copy link
Contributor

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.

Cypher30 and others added 30 commits July 14, 2022 16:07
Comment on lines 80 to 81
class PofoSolver:

Copy link
Contributor

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 *
Copy link
Contributor

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:
Copy link
Contributor

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.

@FrankLeeeee FrankLeeeee merged commit 933b6c6 into hpcaitech:main Sep 20, 2022
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.

None yet

2 participants