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

[BUG] M1 Mac has an issue with hostname -I not being a valid command #5597

Open
AbhinavMir opened this issue May 31, 2024 · 7 comments
Open
Assignees
Labels
bug Something isn't working build Improvements to the build and testing systems.

Comments

@AbhinavMir
Copy link

Not a particular issue I was facing, but a very offline friend who was using deepspeed initializes got an error where HostName -I isn't available on the M1 chip or OSX in general.

A workaround I can think of is using ifconfig | grep 'inet ' | awk '{print $2}' | paste -sd ' ' instead of hostname -I - and this code fails in ./deepspeed/launcher/runner.py: ssh_check_cmd += f" {first_host} hostname -I" so probably a check for OS type using uname and then running a specific bit of code. Currently I just added a new binary to replace hostname that runs the original hostname but also parses -I to run ifconfig but it probably isn't the best idea.

I am not an AI developer but just my 2 cents!

@AbhinavMir AbhinavMir added bug Something isn't working compression labels May 31, 2024
@loadams
Copy link
Contributor

loadams commented May 31, 2024

Hi @AbhinavMir - can you share the specific error? I know others have been able to run on M1 Macs in the past, so is it possible that the inetutils package wasn't installed which contains hostname?

@loadams loadams self-assigned this May 31, 2024
@loadams loadams added build Improvements to the build and testing systems. and removed compression labels May 31, 2024
@AbhinavMir
Copy link
Author

Hi Logan, I'll talk to the friend really quick and get back to you, but iirc hostname was available, but not the -I flag.

@loadams
Copy link
Contributor

loadams commented Jun 26, 2024

Hi @AbhinavMir - closing this PR as stale for now, if you're able to get a little more info, please comment and we can investigate and re-open.

@loadams loadams closed this as completed Jun 26, 2024
@RuslanProgrammer
Copy link

Hello. I got the same error on Apple M3, MacOS Solomona 14.5 (23F79)

[2024-07-01 11:07:31,491] [INFO] [logging.py:96:log_dist] [Rank -1] DeepSpeed info: version=0.14.4, git-hash=unknown, git-branch=unknown
[2024-07-01 11:07:31,491] [INFO] [comm.py:637:init_distributed] cdb=None
[2024-07-01 11:07:31,492] [INFO] [comm.py:652:init_distributed] Not using the DeepSpeed or dist launchers, attempting to detect MPI environment...
[...70358] shmem: mmap: an error occurred while determining whether or not /var/folders/75/... could be created.
hostname: illegal option -- I
usage: hostname [-f] [-s | -d] [name-of-host]
Traceback (most recent call last):
  File "/Users/.../class.py", line 139, in <module>
    model_engine, optimizer,__, __ = deepspeed.initialize(
  File "/Users/.../.venv/lib/python3.9/site-packages/deepspeed/__init__.py", line 143, in initialize
    dist.init_distributed(dist_backend=dist_backend,
  File "/Users/.../.venv/lib/python3.9/site-packages/deepspeed/comm/comm.py", line 658, in init_distributed
    mpi_discovery(distributed_port=distributed_port, verbose=verbose)
  File "/Users/.../.venv/lib/python3.9/site-packages/deepspeed/comm/comm.py", line 686, in mpi_discovery
    result = subprocess.check_output(hostname_cmd, shell=True)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['hostname -I']' returned non-zero exit status 1.

So when I run hostname -I in the terminal, I get the same error. Moreover inetutils 2.5 is already installed.

@loadams
Copy link
Contributor

loadams commented Jul 1, 2024

Hi @RuslanProgrammer - can you please share the output of running just hostname -I in the terminal?

@RuslanProgrammer
Copy link

$ hostname -I
hostname: illegal option -- I
usage: hostname [-f] [-s | -d] [name-of-host]

@loadams loadams reopened this Jul 1, 2024
@loadams
Copy link
Contributor

loadams commented Jul 1, 2024

Thanks @RuslanProgrammer and @AbhinavMir - we've confirmed on an Intel Mac that the -I option is also not available there, so this appears to be an issue with OSX rather than the M series Macs.

We will need to find either another way to list the IPs on Macs, I'll have to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Improvements to the build and testing systems.
Projects
None yet
Development

No branches or pull requests

3 participants