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 a bug in infer method #1340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jlsong01
Copy link
Contributor

What changes were proposed in this pull request?

a bugfix

Why are the changes needed?

the parameter of operator.infer() SHOULD be a list with one element [inference], while NOT the whole list of inferences, because inferences may include the inference which does not match the currrent operator.

Does this PR introduce any user-facing change?

No

How was this patch tested?

pre-commit test and unittest both passed

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.11%. Comparing base (ec94ab6) to head (744c11b).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1340      +/-   ##
==========================================
- Coverage   81.15%   81.11%   -0.04%     
==========================================
  Files         231      231              
  Lines       21965    21965              
==========================================
- Hits        17825    17817       -8     
- Misses       4140     4148       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -46,7 +46,7 @@ def infer(self) -> List[Inference]:
operator = self.get_operator(inference)
if not operator:
continue
infs = operator.infer(inferences)
infs = operator.infer([inference])
Copy link
Collaborator

Choose a reason for hiding this comment

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

@samplise have a look

Copy link
Collaborator

Choose a reason for hiding this comment

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

This implementation will be more accurate in some cases. For example, we have observed two problems a and b during training. We want to identify the root causes for problem a. However, the final results may differ for only observed a from observed a and b together. Therefore we have all problems as the input for more accurate analysis.

Copy link
Contributor Author

@jlsong01 jlsong01 Nov 27, 2024

Choose a reason for hiding this comment

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

Thanks for the comments.

  1. I agree having all problems is better for more accurate analysis.

  2. the further question is, instead of passing all problems in a list, maybe it's better to separate the current problem with the other problems. Because the current operator cares more about the current problem than the others. If we pass them all in one list, the above information will be lost

  3. Currently some infer() implementation ALWAYS refer to problems list[0] only, this isn't what we expected, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@samplise how about the comment?

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