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

AMX extension #68

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

AMX extension #68

wants to merge 15 commits into from

Conversation

cyssi-cb
Copy link

No description provided.

Comment on lines +366 to +369
} else if (item == "AMX") {
cb.tdpbf16ps(Tmm(counter%6), tmm6, tmm7);
counter++;
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this seems to be the only addition to the stock AVX512 payload can we integrate it there instead?

rc = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_PERM, XFEATURE_XTILEDATA);

if(rc){
printf("XTILE_DATA request failed: %ld", rc);
Copy link
Collaborator

Choose a reason for hiding this comment

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

please change to workerLog:: trace, error etc.

public:
SapphireRapidsConfig(asmjit::CpuFeatures const &supportedFeatures,
unsigned family, unsigned model, unsigned threads)
: X86PlatformConfig("SKL_XEONEP", 6, {85}, {1, 2}, 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The first string should represent a short hand for Sapphire Rapids, this one is for Skylake.
Family and Model should be adjusted to 6 and 143 respectively. Search for CPUID on https://en.wikichip.org/wiki/intel/microarchitectures/sapphire_rapids

@@ -39,7 +39,7 @@ git_submodule_update()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
else()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2 -fdata-sections -ffunction-sections")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mamx-int8 -mamx-tile -Wall -Wextra -O2 -fdata-sections -ffunction-sections")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these necessary?

class AVX512_AMX_Payload final : public X86Payload {
public:
AVX512_AMX_Payload(asmjit::CpuFeatures const &supportedFeatures)
: X86Payload(supportedFeatures, {asmjit::CpuFeatures::X86::kAMX_BF16},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Checking for the kAMX_BF16 feature may have prevented you from integrating the AMX code it into the AVX512 payload. Can we check this feature if the "AMX" meta-instruction is selection during the compilePayload step instead?

SapphireRapidsConfig(asmjit::CpuFeatures const &supportedFeatures,
unsigned family, unsigned model, unsigned threads)
: X86PlatformConfig("SKL_XEONEP", 6, {85}, {1, 2}, 0,
{32768, 1048576, 1441792}, 1048576000, 1536, family,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume these values also have not been updated

Comment on lines +54 to +57
void create_AMX_config(__tilecfg *tileinfo);
void request_permission();
void init_buffer_rand(uintptr_t buf1, uintptr_t buf2);

Copy link
Collaborator

Choose a reason for hiding this comment

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

please define them as static functions inside the AVX512_AMX_Payload class or inside a new class handling the amx permissions and configs

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.

2 participants