Skip to content

Add thread yield function for spin-loops.#82

Closed
devinamatthews wants to merge 1 commit into
flame:masterfrom
devinamatthews:spin_yield
Closed

Add thread yield function for spin-loops.#82
devinamatthews wants to merge 1 commit into
flame:masterfrom
devinamatthews:spin_yield

Conversation

@devinamatthews
Copy link
Copy Markdown
Member

I noticed that TBLIS outperforms BLIS by about 30 GFLOP/s (400 vs. 370) on 12 cores of Lonestar 5 (both using OMP). To try and fix this I added a pause instruction in the spin-loop for Intel architectures, but alas there is no improvement. In any case, the optional macro BLIS_YIELD that I added in bli_kernel.h might be useful.

@fgvanzee, @tlrmchlsmth we should go over the respective codes at some point and figure out why TBLIS is faster.

@jeffhammond
Copy link
Copy Markdown
Member

Is the 8% deviation reproducible within a single job, i.e. the same node over a short time interval?

I'll see if I can reproduce locally.

@gaming-hacker
Copy link
Copy Markdown

what happened to this? why wasn't merged?

@devinamatthews
Copy link
Copy Markdown
Member Author

@gaming-hacker I haven't measured any performance improvement from pause (which isn't too surprising since it is best not to use HyperThreads with BLIS), so there isn't a real rush to merge. Also, it would probably behoove me to add a similar feature for ARM at the same time.

@jeffhammond
Copy link
Copy Markdown
Member

FYI the OpenBLAS have been looking at the same issue, but don't have a clear conclusion: OpenMathLib/OpenBLAS#1051

BhaskarNallani pushed a commit to amd/blis that referenced this pull request Jul 28, 2025
…ame#82)

The blis.h header file includes a lot of BLIS internal definitions. Some of these caused problems
when using a BLIS library compiled with clang on Windows from an applications compiled with
the Intel icc and icx compilers. Workaround is to use "#ifdef BLIS_IS_BUILDING_LIBRARY" to
guard these definitions from being exposed to applications including blis.h. (The BLIS configure
and cmake builds systems automatically define BLIS_IS_BUILDING_LIBRARY only for compiling
the BLIS library.)

This patch implements the minimum changes to resolve the issue. Longer term, similar changes
may need to be added around all BLIS internal definitions in blis.h.

AMD-Internal: [CPUPL-6953]
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.

3 participants