Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Slower matrixmultiply in nightly-2017-12-16 #46923

Closed
bluss opened this issue Dec 21, 2017 · 7 comments
Closed

Slower matrixmultiply in nightly-2017-12-16 #46923

bluss opened this issue Dec 21, 2017 · 7 comments
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) C-bug Category: This is a bug. I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@bluss
Copy link
Member

bluss commented Dec 21, 2017

  • Good rustc 1.24.0-nightly (0077d12 2017-12-14) (rustup nightly-2017-12-15)
  • Bad rustc 1.24.0-nightly (77efd68 2017-12-15) (rustup nightly-2017-12-16)

matrixmultiply version 0.1.14. This code is deliberately seeking autovectorization, and it's understood that such things could be fragile; but for a long time it has worked fine.

Before:

RUSTFLAGS=-Ctarget-feature=+avx cargo +nightly-2017-12-15 bench -v m127

test mat_mul_f32::m127             ... bench:     121,631 ns/iter (+/- 10,097)
test mat_mul_f64::m127             ... bench:     198,662 ns/iter (+/- 13,402)

After:

RUSTFLAGS=-Ctarget-feature=+avx cargo +nightly-2017-12-16 bench -v m127

test mat_mul_f32::m127             ... bench:     209,268 ns/iter (+/- 12,809)
test mat_mul_f64::m127             ... bench:     295,810 ns/iter (+/- 2,167)

The PRs in that range are:

git log --oneline --first-parent 0077d128d..77efd6800
77efd68 Auto merge of #46623 - eddyb:issue-46449, r=nagisa
50f6c3e Auto merge of #46745 - steveklabnik:rollup, r=steveklabnik
5a0dc2d Auto merge of #46740 - oli-obk:rls, r=nrc
b4f3232 Auto merge of #46706 - sunjay:gat-lifetimes, r=nikomatsakis
04b2344 Auto merge of #46653 - estebank:str-as-ch, r=petrochenkov
84feab3 Auto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1
9331031 Auto merge of #46701 - eddyb:vector-newtypes, r=nagisa
2f35141 Auto merge of #46641 - petrochenkov:nohelp2, r=nikomatsakis

@kennytm kennytm added C-bug Category: This is a bug. I-slow Issue: Problems and improvements with respect to performance of generated code. A-SIMD Area: SIMD (Single Instruction Multiple Data) labels Dec 21, 2017
@pmarcelll
Copy link
Contributor

This might be the same issue as #46897.

@eddyb
Copy link
Member

eddyb commented Dec 22, 2017

@pmarcelll I think so too. @bluss As per #46897 (comment), can you retry with the latest nightly?

EDIT: that might've been accidental, given no relevant changes, and the regression is back anyway.

@bluss
Copy link
Member Author

bluss commented Dec 23, 2017

New results (no fix ☹️ )

  • Bad rustc 1.24.0-nightly (7eb64b8 2017-12-20) (rustup +nightly-2017-12-21)
  • Bad rustc 1.24.0-nightly (250b492 2017-12-21) (rustup +nightly-2017-12-22)
  • Bad rustc 1.24.0-nightly (5165ee9 2017-12-22) (rustup +nightly-2017-12-23)

@bluss
Copy link
Member Author

bluss commented Dec 23, 2017

I haven't had time to investigate, but I'll do that over christmas.

@arielb1
Copy link
Contributor

arielb1 commented Dec 23, 2017

This really looks like #46897

@bluss
Copy link
Member Author

bluss commented Dec 23, 2017

Probably. The reason I discovered it was due to that issue, but when I read it it seemed to talk about a different nightly version as the breaking point, so I reported this too.

@bluss
Copy link
Member Author

bluss commented Dec 28, 2017

Fixed in rustc 1.24.0-nightly (1abeb43 2017-12-27) 🌟 @eddyb 🌟

RUSTFLAGS=-Ctarget-feature=+avx\ -Ccodegen-units=1 cargo +nightly bench -v m127
test mat_mul_f32::m127             ... bench:     123,960 ns/iter (+/- 8,354)
test mat_mul_f64::m127             ... bench:     194,921 ns/iter (+/- 3,862)

So it was resolved like #46897

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) C-bug Category: This is a bug. I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

5 participants