uber / fiber

Distributed Computing for AI Made Simple
https://uber.github.io/fiber/
Apache License 2.0
1.04k stars 110 forks source link

Value Error (not enough values to unpack) in pool.py #44

Open ANarayan opened 3 years ago

ANarayan commented 3 years ago

https://github.com/uber/fiber/blob/b9d519ebfd572e49af7f1c6a235d19d4396207cb/fiber/pool.py#L908

I am getting the following error: ValueError: not enough values to unpack (expected 3, got 2) on line 908 in pool.py.

The error is being raised when I am calling fiber using docker as the backend.

This the command I am using to call the script: FIBER_BACKEND=docker FIBER_IMAGE=docker-test:latest python test_fiber_docker.py

calio commented 3 years ago

Can you provide a minimized test case (don't need to provide all of test_fiber_docker.py, just enough to reproduce this error)? Also, what OS are you running and what python version are you using?

ANarayan commented 3 years ago

Here is a minimized test case for reproducing the error:

import ludwig
import yaml
from ludwig.hyperopt.run import hyperopt

filename="config_docker.yaml"
file_path="goemotions.csv"

with open(filename) as f:
    file_contents = yaml.load(f, Loader=yaml.SafeLoader)

model_config = file_contents
hyperopt_results = hyperopt(
                model_config,
                dataset=file_path,
                model_name="goemotions_bert",
                output_directory="."
            )

Here is the contents of config_docker.yaml:

input_features:
- encoder: bert
  level: word
  name: text
  type: text
output_features:
- name: emotion_ids
  type: set
hyperopt:
  sampler:
    type: random
    num_samples: 50
  executor:
    type: fiber
    num_workers: 10
    fiber_backend: docker
    num_cpus_per_worker: 2

My OS is: Darwin 18.7.0 Darwin Kernel Version 18.7.0 Python version: Python 3.7.7

Let me know if you need any more info!

Basasuya commented 3 years ago

I think the problem is at docker_backend.py:195

        if sys.platform == "darwin":
            # use the same hostname for both master and non master process
            # because docker.for.mac.localhost resolves to different inside
            # and outside docker container. "docker.for.mac.localhost" is
            # the name that doesn't change in and outside the container.
            return "docker.for.mac.localhost", 0

it returns two elements.

But after I modify it, I still can not run through all the test on the MAC OS.

calio commented 3 years ago

Hi @Basasuya , Fiber current doesn't work on Mac OS with Docker, see doc. But yeah, the return value is a bug that needs to be fixed.