-
Notifications
You must be signed in to change notification settings - Fork 240
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
[Good First Issue] [NNCF] Make NNCF common graph code pass mypy checks #2495
Comments
I wish to request to allocation for this issue. It is in preperation for GSoC 2024 eligibility. |
.take |
Thank you for looking into this issue! Please let us know if you have any questions or require any help. |
Hi @vshampor @rkazants @mlukasze ! I'm excited to address the mypy checks for the NNCF common graph code. Here's my plan: Install Mypy: Configuration File: Type Annotations: Run Mypy: Addressing Issues: Iterative Testing: Feel free to provide additional insights or specific preferences you may have. I'm committed to delivering a clean and well-typed NNCF common graph code. Looking forward to your feedback. |
@prajak002 this exact issue seems to have already been taken. I have created #2494 which is basically the same task, but for a different, mostly non-overlapping part of code - you can take that if you want. |
Thank you Sir! I'll take on #2494 for the non-overlapping part. Let me know if there are any specifics I should be aware of. Appreciate your collaboration. |
Implementation Plan for NNCF Common Graph Code Mypy ComplianceSubject: Expedited Plan for Mypy Compliance in NNCF Common Graph Code IntroductionI am enthusiastic about contributing to the NNCF project and am keen on participating in GSoC 2024 with your organization. Given my limited availability, I propose an expedited implementation plan to address the mypy compliance issue (#22196) within a week, starting January 20th. Timezone and AvailabilityMy timezone is IST (GMT+5:30). I can dedicate 1.5 hours daily to this project. ObjectiveTo make all files under nncf/common/graph compliant with mypy checks, in line with the .mypy.ini configuration. This task involves correcting type hint issues and ensuring Python 3.8 type hinting standards. Expedited Implementation Steps and Timeline
Morning: Set up the local development environment.
Categorize mypy errors and prioritize files based on error complexity and impact.
Address simpler type hint errors across multiple files.
Tackle more complex type hint issues.
Continue refactoring for improved type hint clarity.
Morning: Update documentation and comments to reflect changes.
Prepare the code for final review.
Use this time for any final adjustments or to address immediate feedback from the project maintainers. ConclusionThis expedited plan is designed to efficiently address the mypy compliance issue in the NNCF common graph code, maintaining high standards of code quality within the constrained timeframe. I look forward to contributing to this project and gaining valuable experience for GSoC 2024. For further discussion or clarifications regarding this implementation plan, please feel free to reach out. Best regards, |
@prajak002 sorry, looks like the #2494 was taken before you could react. I created #2497 and asked @rkazants to assign you directly this time, this is the same stuff but yet for another code path. |
@vshampor ; As I am already halfway done with my implementation plan for the current issue #2495 ; may I just put my pull request and then move on to the next issue after that ? It appears some other person is assigned to #2493 regardless; Please let me continue with work on the current issue. |
@Grimoors sorry, did not pay enough attention and mistaken you for someone else who wanted a part of this task. Sure, please continue with this one, we are eagerly waiting for the PR. |
Quick update; I am still working on it and I am behind schedule due to unexpected increase of bugs after install of types-networkx on local to get rid of an error. Requesting extension till 5th Feb , 23:55 hrs IST. |
Hello @Grimoors, are you still working on this issue or can we reassign it? |
I am sorry for delay, still on it. |
I'm reopening the issue due to current assignee's inactivity. If you're still working on this you can repick the task. |
@p-wysocki I apologise for my inactivity. |
There's no need to apologize, we're just making sure all assigned issues are actually in progress. :) If you wish to continue working on this task or picking up another feel free to do so, you're always welcome to contribute. |
If @Grimoors is no longer working on this I'd like to pick it up. :) |
It's okay with me, but sadly I currently do not have proper permissions to assign/unassign people to issues created in the NNCF repository. @vshampor could you please help here? |
@DaniAffCH I am keen to continue work on this. |
Ok no problem :) |
The assignee was unassigned due to the lack of activity. |
.take |
Thank you for looking into this issue! Please let us know if you have any questions or require any help. |
Hi, I just opened a PR for this |
### Changes This PR closes issue #2495 by addressing various mypy checks and enhancing type safety in the codebase. - Resolved specific mypy errors related to type inconsistencies. - Utilized `# type:ignore` for cases requiring significant refactoring due to untyped packages like `networkx`. - Added the directory `nncf/common/graph` to `.mypy.ini` to include additional files for type checking. ### Related Tickets N/A ### Tests Pytests were run to ensure that the changes did not modify the common logic and that the codebase remained functional.
Context
NNCF code is mostly typed with conventional type hints, but historically had started out and grown without a CI-enforced
mypy
conformance process in place. Since typing is paramount for software systems of any appreciable complexity, NNCF needs to take steps to attain, ideally, full mypy coverage of at least its non-test code base. The scope of this exact task, however, will be necessarily to start out small, as recommended by the mypy devs.Task
Make the files under
nncf/common/graph
, which define the classes and logic for NNCF's main control flow graph abstraction, passmypy
without failures. Use the following.mypy.ini
file:Create this file with the contents above in the repository root, install NNCF in editable mode by running
pip install -e .
from the repository root and then runmypy
in command line.This should produce the output similar to the following:
Walk through the relevant code lines that produced each error and correct them by setting up missing type hints or correcting the existing ones. It should be possible to infer the required type hints from the function bodies and/or usages in most cases; resort to inline-disabling
mypy
for certain lines by# type:ignore
only if setting up correct type hints requires massive refactoring.Refer to https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html for basic type hinting information. Use type hints compatible with Python 3.8, e.g.
List
from thetyping
module instead oflist
etc.The text was updated successfully, but these errors were encountered: