Skip to content

[Fix] memory leak after the fisrt moe decoder layer#1630

Open
NengXu001 wants to merge 1 commit intoInternLM:mainfrom
NengXu001:gc_collect
Open

[Fix] memory leak after the fisrt moe decoder layer#1630
NengXu001 wants to merge 1 commit intoInternLM:mainfrom
NengXu001:gc_collect

Conversation

@NengXu001
Copy link
Copy Markdown
Contributor

Forces a gc to prevent extra memory occupation after the fisrt moe decoder layer.


router_logits = [router_results["logits"] for router_results in router_results_list]
router_weights = [router_results["router_weights"] for router_results in router_results_list]
run_gc_once()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please test directly on the NPU with the main branch to see if the memory leak issue still exists. If it does, we may need to figure out why reference count-based reclamation is failing.

@HAOCHENYE HAOCHENYE added the npu label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants