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

Enable protoboeuf-encode benchmark on TruffleRuby #332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrykonchin
Copy link

The benchmark was disabled in #325. Now the issue is fixed (in oracle/truffleruby#3674).

@k0kubun
Copy link
Member

k0kubun commented Sep 26, 2024

Is truffleruby-head not updated yet?

Failed benchmarks:
  ruby: protoboeuf-encode

@k0kubun
Copy link
Member

k0kubun commented Sep 26, 2024

TBH we want to test yjit-bench here instead of the TruffleRuby project. Given how unstable this job has been so far and the fact that it has been mostly due to TruffleRuby's bugs, I think this job should live in oracle/truffleruby and not in this repository.

If our interest is not to test the edge TruffleRuby but make sure yjit-bench works with TruffleRuby, we should run a released stable version of TruffleRuby instead of the HEAD TruffleRuby. yjit-bench's CI shouldn't randomly fail when nothing has been changed in yjit-bench.

@andrykonchin
Copy link
Author

Yeah, looks like a build for the fix isn't ready yet (the fix was merged today). Will retry jobs tomorrow.

@eregon
Copy link
Contributor

eregon commented Sep 26, 2024

Yeah, looks like a build for the fix isn't ready yet (the fix was merged today). Will retry jobs tomorrow.

FWIW that's easily visible at https://github.com/ruby/truffleruby-dev-builder which shows which commit the latest build used.

@eregon
Copy link
Contributor

eregon commented Sep 26, 2024

TBH we want to test yjit-bench here instead of the TruffleRuby project. Given how unstable this job has been so far and the fact that it has been mostly due to TruffleRuby's bugs,

In this case at least it was not a bug, protoboeuf is using a method from Ruby 3.3, so that was not available yet on other Ruby implementations. For most gems out there they would support older Ruby versions and so it's quite a special case.

Given how unstable this job has been so far

The only case I recall is #262, were there many others?

I also think it is important to test another Ruby than just CRuby, otherwise the harness is likely to become accidentally CRuby-specific.

If our interest is not to test the edge TruffleRuby but make sure yjit-bench works with TruffleRuby, we should run a released stable version of TruffleRuby instead of the HEAD TruffleRuby. yjit-bench's CI shouldn't randomly fail when nothing has been changed in yjit-bench.

That's fair, we should try switching to a release of TruffleRuby.
I think only protoboeuf-encode* would fail, which seems OK as it's a very CRuby/YJIT-specific gem, considering the generated code it emits (huge methods).

@maximecb
Copy link
Contributor

I think only protoboeuf would fail, which seems OK as it's a very CRuby/YJIT-specific gem, considering the generated code it emits (huge methods).

You should have no problem handling that generated code. It's not CRuby-specific.

@eregon
Copy link
Contributor

eregon commented Sep 26, 2024

It executes correctly, it's just that

def decode_from(buff, index, len)
is too big to be compiled by a method JIT (1400 lines long).
Anyway, I shouldn't have mentioned that here, it's pretty much orthogonal.

@k0kubun
Copy link
Member

k0kubun commented Sep 26, 2024

The only case I recall is #262, were there many others?

It had three benchmarks. yjit-bench used to stop at a single benchmark failure, so it was three round-trips, which were already too many for me. We have two others failing right now that happened separately, so five cases in total.

That's fair, we should try switching to a release of TruffleRuby.

👍

@maximecb
Copy link
Contributor

maximecb commented Sep 26, 2024

too big to be compiled by a method JIT (1400 lines long).

I think you mean too big for your method JIT. Google's V8 handles this sort of thing just fine 😉

@eregon
Copy link
Contributor

eregon commented Sep 27, 2024

Actually it compiles fine, my bad, probably because it's a lot of very simple arithmetic, and the benchmark likely uses only a small portion of the many branches:
[engine] opt done engine=1 id=2126 ProtoBoeuf::TrunkItem#decode_from |Tier 2|Time 236( 110+126 )ms|AST 11185|Inlined 47Y 0N|IR 4401/ 7516|CodeSize 29163|Addr 0x7f20e00da000|UTC 2024-09-27T10:10:02.328|Src benchmark_pb.rb:888 0x2acaf309

In the source code it certainly looks like a lot of duplication and something the JIT should be able to decide whether to inline or not (which it could if it's a separate method).


I'll make a PR to switch to a release of TruffleRuby in CI: #334

@andrykonchin andrykonchin force-pushed the ak/enable-protoboeuf-on-truffleruby branch from e0bbac8 to ee8e5b5 Compare September 27, 2024 10:42
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.

4 participants