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: segmentation fault error in streaming tokens #485

Merged
merged 8 commits into from
Mar 3, 2025

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Feb 26, 2025

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

fix: segmentation fault error while streaming tokens

Fixes #454 and #459.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@bhimrazy
Copy link
Collaborator Author

Removing the following line does resolve the issue; however, it will prevent memory-mapped files (mmaps) from being properly closed. Ideally, this is not a good solution, as it may lead to resource leaks.

self._mmaps[chunk_index]._mmap.close()

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79%. Comparing base (f6660be) to head (f8aceee).
Report is 2 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #485   +/-   ##
===================================
- Coverage    79%    79%   -0%     
===================================
  Files        38     38           
  Lines      5620   5626    +6     
===================================
- Hits       4458   4456    -2     
- Misses     1162   1170    +8     

@deependujha deependujha marked this pull request as ready for review March 2, 2025 16:58
@bhimrazy bhimrazy changed the title [wip]: fix segmentation fault error in streaming tokens fix: segmentation fault error in streaming tokens Mar 2, 2025
Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Awesome work @bhimrazy @deependujha :)

@tchaton tchaton merged commit 549cc89 into Lightning-AI:main Mar 3, 2025
36 checks passed
@bhimrazy bhimrazy deleted the fix/seg-fault-error branch March 3, 2025 08:45
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.

Optimize tokens throws seg fault
3 participants