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

Performance of hvm-c is unstable with some programs #378

Open
developedby opened this issue Jun 7, 2024 · 0 comments
Open

Performance of hvm-c is unstable with some programs #378

developedby opened this issue Jun 7, 2024 · 0 comments

Comments

@developedby
Copy link
Member

Reproducing the behavior

This seems to be the underlying issue of HigherOrderCO/Bend#525.

For some programs, the C runtime can have wildly different performance on different executions.
This might be due to bad memory allocations, bad distribution of work among threads or something completely different.

I'm able to reproduce this issue with this bend program

def sum(depth, x):
  switch depth:
    case 0:
      return x
    case _:
      fst = sum(depth-1, x*2+0) # adds the fst half
      snd = sum(depth-1, x*2+1) # adds the snd half
      return fst + snd
    
def main:
  return sum(25, 0)

@imaqtkatt also tried this.
It seems that on ARM Macs the performance is a bit more consistent

System Settings

Example:

  • OS: Linux (openSUSE Tumbleweed)
  • CPU: AMD Ryzen 7 5800H
  • GPU: [e.g. RTX 4090]
  • HVM: Tested on 2.0.17 and 2.0.18

Additional context

No response

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

No branches or pull requests

1 participant