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

Fix attribute error for detr #1008

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

meenakshiramanathan1
Copy link
Contributor

@meenakshiramanathan1 meenakshiramanathan1 commented Jan 6, 2025

No description provided.

@@ -29,6 +29,9 @@ def test_detr_detection(variant):
input_batch = preprocess_input_data(image_url)

# Compiler test
compiler_cfg = forge.config._get_global_compiler_config()
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try without model overrides. It would be best to fix the root cause of the issue without fine-tuning compiler behavior.

Do you have a wider context of the problem solved with these flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zeros op is binded as global_var and passed as input params to tvmgen_default_forge_main.
def @main(%pixel_values: Tensor[(1, 3, 427, 640), float32] /* ty=Tensor[(1, 3, 427, 640), float32] span=aten::size_0.pixel_values:0:0 */, %model.query_position_embeddings.weight: %0 = zeros(shape=[1, 100, 256], dtype="float32") /* ty=Tensor[(1, 100, 256), float32] span=C.graph: aten::zeros_like, jit._trace.TopLevelTracedModule: %1 = @tvmgen_default_forge_main_0(%0, %model.query_position_embeddings.weight, %model.decoder.layers.0.

This behaviour is observed after tvm transform.PartitionGraph , hence adding these flags was binding the zeros op into tvm module.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, do you have an example from reportify of how this looks like?

Copy link
Contributor

Choose a reason for hiding this comment

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

And do you know where are these zeros coming from? I can't infer precise info based on TVM IR you provided..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the changes now by bringing in a workaround in forge_utils mentioned here.

@meenakshiramanathan1 meenakshiramanathan1 changed the title Add tvm compiler flags for detr Fix attribute error for detr Jan 9, 2025
@meenakshiramanathan1 meenakshiramanathan1 force-pushed the mramanathan/detr branch 2 times, most recently from e39f1e7 to c53886b Compare January 9, 2025 05:06
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.

2 participants