Skip to content

Conversation

jiashenC
Copy link
Contributor

@jiashenC jiashenC commented Jul 17, 2024

Issue

ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger CallMethod and this PR adds that support as well.

Test Plan

Add test case for ScriptObject.
pytest test/export/test_converter.py -s -k test_convert_script_object

Copy link

pytorch-bot bot commented Jul 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/130952

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 86a724d with merge base 6c65fd0 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jiashenC jiashenC added the topic: not user facing topic category label Jul 17, 2024
@jiashenC jiashenC requested a review from angelayi July 17, 2024 18:43
@jiashenC jiashenC marked this pull request as ready for review July 17, 2024 18:43
@jiashenC jiashenC force-pushed the fix_script_object branch from cd57526 to 469f634 Compare July 18, 2024 22:46
@jiashenC jiashenC requested a review from ydwu4 as a code owner July 19, 2024 22:56
@jiashenC jiashenC force-pushed the fix_script_object branch from 65aaaac to 0cb99c3 Compare July 24, 2024 16:39
@facebook-github-bot
Copy link
Contributor

@jiashenC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Jul 24, 2024
Summary:
#### Issue
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.


Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60177312


attr_value = node.output()
if self.is_top_level_graph():
if attr_value.type().annotation_str == "Tensor":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find this check to be not reliable, e.g., sometimes this is Optional[Tensor].

@jiashenC jiashenC requested a review from angelayi July 24, 2024 23:26
jiashenC added a commit that referenced this pull request Jul 26, 2024
Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
@jiashenC jiashenC force-pushed the fix_script_object branch from eb6efea to 3b74950 Compare July 26, 2024 17:37
jiashenC added a commit that referenced this pull request Jul 26, 2024
Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
jiashenC added a commit that referenced this pull request Jul 30, 2024
Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
jiashenC added a commit that referenced this pull request Aug 1, 2024
Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
@jiashenC jiashenC force-pushed the fix_script_object branch from 3b74950 to 7c1f34c Compare August 1, 2024 23:45
@facebook-github-bot
Copy link
Contributor

@jiashenC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jiashenC jiashenC force-pushed the fix_script_object branch from b316509 to b24fbfa Compare August 2, 2024 15:49
@facebook-github-bot
Copy link
Contributor

@jiashenC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

jiashenC added a commit that referenced this pull request Aug 3, 2024
Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
@jiashenC jiashenC force-pushed the fix_script_object branch from b24fbfa to 491948b Compare August 3, 2024 00:09
@facebook-github-bot
Copy link
Contributor

@jiashenC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:
ScriptObject was treated as normal attribute by the converter previously. This PR lifts it to be a constant and convert it directly to a GetAttr fx node. ScriptObject would also trigger `CallMethod` and this PR adds that support as well.

Test Plan:
Add test case for ScriptObject.
`pytest test/export/test_converter.py -s -k test_convert_script_object`

Differential Revision: D60177312

Pulled By: jiashenC
@jiashenC jiashenC force-pushed the fix_script_object branch from 491948b to 86a724d Compare August 4, 2024 02:09
@facebook-github-bot
Copy link
Contributor

@jiashenC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions github-actions bot deleted the fix_script_object branch September 5, 2024 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants