Skip to content

[TIR][USMP] Augmenting the algo interface with memory pressure#9649

Merged
leandron merged 1 commit into
apache:mainfrom
manupak:usmp_algo_interface_memory_pressure
Dec 7, 2021
Merged

[TIR][USMP] Augmenting the algo interface with memory pressure#9649
leandron merged 1 commit into
apache:mainfrom
manupak:usmp_algo_interface_memory_pressure

Conversation

@manupak

@manupak manupak commented Dec 3, 2021

Copy link
Copy Markdown
Contributor

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
@manupak manupak force-pushed the usmp_algo_interface_memory_pressure branch from 016de4e to 4a62348 Compare December 4, 2021 09:39

@lhutton1 lhutton1 left a comment

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.

LGTM, although could probably do with another pair of eyes as I'm unfamiliar with USMP on the whole :)

Map<BufferInfo, tir::Stmt> buffer_info_stmts;
/*! \brief This represent maximum amount of memory being used at
* any point of time in the inference. This value is largely the
* best allocation an algorithm could achieve. Due to

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.

A naive question which I think I might already know the answer to... why is the 'best' allocation considered one that is closer to the maximum memory pressure rather than say the least amount of memory used?

@manupak manupak Dec 6, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! @lhutton1 .

The maximum memory used is the summation of all conflicted buffers/tensors at any point in the lifetime of the inference. No matter how a memory allocation perform, it will not beat this value because those tensors "have" to be live with each other. Therefore this is the value a memory planning algorithm strives to achieve that corresponds to the theoretical "peak" memory usage

Then it begs the question, why would an algorithm will not achieve this ?

That is due to the complexity of the problem and it might not be able to figure out an offset ordering in tractable time that meets the above value. It might as well be there does not exist static a set of offsets that tightly bind the tensors to achieve that.

Does that help ?

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.

That's great, thanks!

@manupak

manupak commented Dec 6, 2021

Copy link
Copy Markdown
Contributor Author

Pinging @leandron. PTAL when you have some time.

@leandron leandron left a comment

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.

LGTM

@leandron leandron merged commit cb132e2 into apache:main Dec 7, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
…e#9649)

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
…e#9649)

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
…e#9649)

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…e#9649)

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
…e#9649)

This commit adds memory pressue to be an arugment to
the USMP algorithm interface as certain iterative algorithms
could use this as a guide determine the termination
criteria.

Change-Id: I3fb5eea3fe5ba43e68c23625d411e557f6dd89a3
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.

3 participants