feat: support custom ExecutorchBackendConfig in save(output_format='executorch')#4345
Open
shoumikhin wants to merge 1 commit into
Open
feat: support custom ExecutorchBackendConfig in save(output_format='executorch')#4345shoumikhin wants to merge 1 commit into
shoumikhin wants to merge 1 commit into
Conversation
fc3dd0b to
6d52732
Compare
…xecutorch') torch_tensorrt.save(..., output_format="executorch") previously called edge_program.to_executorch() with no arguments, so the default ExecutorchBackendConfig was always used and callers had no way to customize ExecuTorch lowering (e.g. memory planning or device placement). Add an optional backend_config kwarg to save() that is forwarded to to_executorch(), mirroring the existing partitioners= and compile_specs= kwargs. When backend_config is passed with a non-executorch output_format it is ignored with a warning, matching the existing behavior for partitioners= and compile_specs=.
6d52732 to
7259377
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
torch_tensorrt.save(..., output_format="executorch")previously callededge_program.to_executorch()with no arguments, so the defaultExecutorchBackendConfigwas always used and callers had no way to customize ExecuTorch lowering (e.g. memory planning or device placement).This adds an optional
backend_configkwarg tosave()that is forwarded toto_executorch(), mirroring the existingpartitioners=andcompile_specs=kwargs. Whenbackend_configis passed with a non-executorchoutput_formatit is ignored with a warning, matching the existing behavior for those kwargs.Type of change