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

Remove default CPU_TARGET=avx #10346

Closed
wants to merge 5 commits into from

Conversation

majetideepak
Copy link
Collaborator

@majetideepak majetideepak commented Jun 28, 2024

The default should be empty so that the CPU_TARGET/CPU_ARCH will be inferred.
Remove SSE support for macos as developers are mostly on Intel avx or Apple arm.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 28, 2024
Copy link

netlify bot commented Jun 28, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 004468d
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/668e8527b0928c0008eccb3f

Copy link
Collaborator

@czentgr czentgr left a comment

Choose a reason for hiding this comment

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

Looks good!

scripts/setup-adapters.sh Outdated Show resolved Hide resolved
case $CPU_ARCH in

"arm64")
echo -n "-mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden $ADDITIONAL_FLAGS"
echo -n "-mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we not need -fvisibility-inlines-hidden being added here? It was previously present to avoid log flooding.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see the log messages after removing that. We need to evaluate and specify -fvisibility=hidden and -fvisibility-inlines-hidden for both clang and gcc.

Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

My one concern with this change is that we cannot force builds to use a particular architecture (for e.g you want an SSE only build) - This is sometimes required for e.g if you want to create portable binaries that may need to run on machines that dont have avx.

@@ -46,16 +46,14 @@ jobs:
include:
- name: Check
file: "scripts/check-container.dockfile"
args: "cpu_target=avx"
tags: "ghcr.io/facebookincubator/velox-dev:check-avx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename the tag to check from check-avx then ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

if [[ $CPU_CAPABILITIES =~ "avx" ]]; then
if [ "$OS" = "Darwin" ]; then
if [ "$MACHINE" = "arm64" ]; then
CPU_ARCH="arm64"
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose that mac's with cpu's that dont support avx are not supported anymore ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mac is used by developers and most of them are either on newer ARM64 or the older x86_64 with avx support.
Avx in both Intel and AMD was first available in 2011. We should be safe with the assumption that avx is always available for macs with x86_64.
https://en.wikipedia.org/wiki/Advanced_Vector_Extensions

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds fair - just wanted to confirm.

@@ -32,6 +29,8 @@ ADD scripts /velox/scripts/
# are required to avoid tzdata installation
# to prompt for region selection.
ARG DEBIAN_FRONTEND="noninteractive"
# Set a default timezone, can be overriden via ARG
ARG tz="Europe/Madrid"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why we set Europe/Madrid in first place ..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Jacob added this file and he set Europe as the default.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think its safe to remove this or maybe set it to UTC.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We cannot remove the default arg. Ubuntu tzdata requires this as mentioned in the comment above.
I changed the default to Etc/UTC.
Reference https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image

@majetideepak
Copy link
Collaborator Author

majetideepak commented Jul 9, 2024

My one concern with this change is that we cannot force builds to use a particular architecture (for e.g you want an SSE only build

@kgpai as mentioned in the other comment, avx has been available since a long time now. I doubt there is a use case to build only for sse.

@majetideepak
Copy link
Collaborator Author

We can always add the CPU_TARGET back if there is a use for it.

@kgpai
Copy link
Contributor

kgpai commented Jul 9, 2024

@majetideepak Should we also change the documentation as part of this change (The README still refers to this )

@majetideepak majetideepak changed the title Remove CPU_TARGET and automate arch inference Remove default CPU_TARGET=avx Jul 9, 2024
Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

LGTM (one minor nit though).

@kgpai kgpai added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Jul 9, 2024
@facebook-github-bot
Copy link
Contributor

@pedroerp has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pedroerp merged this pull request in 7f2d7ad.

Copy link

Conbench analyzed the 1 benchmark run on commit 7f2d7ada.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

facebook-github-bot pushed a commit that referenced this pull request Jul 16, 2024
Summary:
Image name was changed as part of #10346

Pull Request resolved: #10438

Reviewed By: pedroerp

Differential Revision: D59776586

Pulled By: mbasmanova

fbshipit-source-id: b233f8a981636f4a09d6cc79eec80fd1b76142d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants