Skip to content

Closes #5028: Fix a small issue in interpretAsBytes - #5029

Merged
ajpotts merged 2 commits into
Bears-R-Us:mainfrom
1RyanK:5028-Fix_a_small_issue_in_interpretAsBytes
Nov 13, 2025
Merged

ajpotts merged 2 commits into
Bears-R-Us:mainfrom
1RyanK:5028-Fix_a_small_issue_in_interpretAsBytes

Conversation

@1RyanK

@1RyanK 1RyanK commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

While Engin was looking at strip, he noticed that interpretAsBytes was incorrect when borrow is set to true. This corrects that error and then also fixes the issue in strip because borrow should be set to true there.

Closes #5028: Fix a small issue in interpretAsBytes

@1RyanK

1RyanK commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

Looking at htop while running

from arkouda.comm_diagnostics import (start_comm_diagnostics, stop_comm_diagnostics, print_comm_diagnostics_table, reset_comm_diagnostics)

N = 10**5
start_comm_diagnostics()
a = ak.random_strings_uniform(8, 2**16, N)
stop_comm_diagnostics()
print_comm_diagnostics_table()

reset_comm_diagnostics()
start_comm_diagnostics()
a.strip("a")
stop_comm_diagnostics()
print_comm_diagnostics_table()

There doesn't seem to be a change in how much RAM this uses (between main and branch) which I think is the crux of #2389. The line a = ak.random_strings_uniform(8, 2**16, N) takes about 3 GB, and the call to strip takes another 13 GB. I tried asking ChatGPT about it and after following its suggestions (basically only strip once) the amount of RAM used did not change. I'm not sure if strip performance on memory can be improved. I'm not sure if it's any faster, it didn't really seem to go any faster but I could be wrong about that and investigate that more. It seemed fair to split these issues out because #2389 is kind of a "investigate to see if there are any possible performance gains" while this is addressing something that is pretty cut and dry.

@ajpotts ajpotts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Wondering a reproducer should be added to the tests.

@ajpotts
ajpotts requested a review from e-kayrakli November 13, 2025 11:06
@e-kayrakli

Copy link
Copy Markdown
Contributor

I wonder if the memory reported by top includes things that the Chapel runtime frees, but never gives back to the OS. lowLevelLocalizingSlice will likely to copy a lot of data.

@ajpotts
ajpotts added this pull request to the merge queue Nov 13, 2025
Merged via the queue into Bears-R-Us:main with commit 3b11644 Nov 13, 2025
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.

Fix a small issue in interpretAsBytes

4 participants