-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refactored forward step #12370
base: mlm-pretrain-loop
Are you sure you want to change the base?
Refactored forward step #12370
Conversation
nemo/tron/api.py
Outdated
@@ -42,6 +44,11 @@ | |||
test_data_iterator = setup_output.test_data_iterator | |||
ckpt_context = setup_output.checkpointing_context | |||
|
|||
if "state" in inspect.getfullargspec(forward_step_func).args: | |||
mcore_forward_step = partial(forward_step_func, state=state) |
Check warning
Code scanning / CodeQL
Variable defined multiple times
nemo/tron/api.py
Outdated
if "state" in inspect.getfullargspec(forward_step_func).args: | ||
mcore_forward_step = partial(forward_step_func, state=state) | ||
if "cfg" in inspect.getfullargspec(forward_step_func).args: | ||
mcore_forward_step = partial(forward_step_func, cfg=full_config) |
Check notice
Code scanning / CodeQL
Unused local variable
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 days ago
To fix the problem, we should remove the assignment to the variable mcore_forward_step
on line 50. This will eliminate the unused variable and clean up the code. Since the variable is not used anywhere else in the function, this change will not affect the existing functionality.
-
Copy modified line R50
@@ -49,3 +49,3 @@ | ||
if "cfg" in inspect.getfullargspec(forward_step_func).args: | ||
mcore_forward_step = partial(forward_step_func, cfg=full_config) | ||
partial(forward_step_func, cfg=full_config) | ||
|
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import contextlib |
Check notice
Code scanning / CodeQL
Unused import
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 days ago
To fix the problem, we need to remove the unused import statement for contextlib
. This will clean up the code and remove the unnecessary dependency, making the code easier to read and maintain.
- Locate the import statement for
contextlib
in the filenemo/tron/llm/gpt.py
. - Remove the line that imports
contextlib
.
@@ -14,3 +14,2 @@ | ||
|
||
import contextlib | ||
from functools import partial |
33fa8b7
to
a291837
Compare
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
a291837
to
27f3f40
Compare
Signed-off-by: Maanu Grover <[email protected]>
beep boop 🤖: 🚨 The following files must be fixed before merge! Your code was analyzed with PyLint. The following annotations have been identified:
Mitigation guide:
By applying these rules, we reduce the occurance of this message in future. Thank you for improving NeMo's documentation! |
Important
The
Update branch
button must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Enable the forward step to take global state, so that GlobalState need not be a singleton.
Collection: [Note which collection this PR will affect]
Changelog
Usage
# Add a code snippet demonstrating how to use this
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information