Skip to content

[ray] Better UX for finding local modules #4479

@SumNeuron

Description

@SumNeuron

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • Ray installed from (source or binary): pip
  • Ray version: latest
  • Python version: 3.5
  • Exact command to reproduce: see linked repo
  1. clone this repo
  2. cd to project folder
  3. jupyter-notebook <cloned-project>/jupyter/
  4. just run the cells

Describe the problem

In the linked repo I provide a M.W.E. of how I envision sacred and tune would work together. Inside there is a local python module named project which contains four submodules model, utils, sacred and tune.

The model submodule has code for a simple twin embedding model in keras (simply to provide some "realism" to the MWE. This code functions and can be tested in the directory jupyter.

The sacred submodule, attempts to decouple sacred specific code as much as possible (e.g. ingredients, observers, etc). If you import the ex from this module it still runs on its own. (again, see the jupyter directory)

The tune submodule is where I envision how tune would wrap the sacred ex for hyperparameter optimization.

Most likely, as I get more familiar with tune (or for users who are) the amount of code here would expand. Nonetheless there are two simple functions, one which wraps sacred, and another which registers the wrapper and expects a hyper-parameter configuration to be passed.

When calling this function ray / tune fails as:

(pid=40079) ModuleNotFoundError: No module named 'project'

which seems to be because of this python module structure.

Notably, if all this code is put at the top level of a module, this works.

I would like to keep this structure though, and I do not see why tune should or would be opinionated about that.

Source code / logs

repo at https://gitlab.com/SumNeuron/extune

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsAn issue or change related to documentationenhancementRequest for new feature and/or capabilityquestionJust a question :)staleThe issue is stale. It will be closed within 7 days unless there are further conversation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions