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

Fallback to default while reading MIDR_EL1 sysfs #96

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Dec 18, 2023

/sysfs is inaccessible while running in AWS Lambda environment, or might be empty if executed inside container on Apple Silicon

Found while debugging pytorch/pytorch#115482 to be cherry-picked into oneDNN later

malfet and others added 2 commits December 17, 2023 19:06
/sysfs is inaccessible while running in AWS Lambda environment, or might be empty if executed inside container on Apple Silicon
@malfet
Copy link
Contributor Author

malfet commented Dec 18, 2023

This time I run clang-format on the file before submitting

@kawakami-k kawakami-k merged commit f43f7e8 into fujitsu:main Dec 18, 2023
@kawakami-k
Copy link
Collaborator

Thank you for the patch!

@@ -440,12 +440,16 @@ class CpuInfoLinux : public CpuInfo {

FILE *file = fopen(path_midr_el1, "r");
if (file == nullptr) {
throw Error(ERR_INTERNAL);
// sysfs is unaccessible for AWS Lambdas
fprintf(stderr, "%s, %d: Can't open MIDR_EL1 sysfs entry\n", __FILE__, __LINE__);

Choose a reason for hiding this comment

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

I suppose printf is not needed here, because this code is used in production where such messages are not allowed

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sandye51
Thank you for the comment.
How about printfing only when the environment variable XBYAK_AARCH64_VERBOSE is defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sandye51 hmm, isn't it the same behavior as one allowed by XBYAK_AARCH64_ERROR_

#define XBYAK_AARCH64_ERROR_ fprintf(stderr, "%s, %d, Error occured while reading cache infomation.\n", __FILE__, __LINE__);

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