Code Monkey home page Code Monkey logo

Comments (5)

JackKelly avatar JackKelly commented on August 29, 2024

Works with num_workers=0

d0f673f

from predict_pv_yield.

JackKelly avatar JackKelly commented on August 29, 2024

5dbfa6c

works with num_workers=2 and with NWPDataLoader being passed into SatelliteDataset

from predict_pv_yield.

JackKelly avatar JackKelly commented on August 29, 2024

It's working with gcsfs 2021.4.0! See fsspec/gcsfs#379 (comment)

from predict_pv_yield.

JackKelly avatar JackKelly commented on August 29, 2024

Still TODO: Try reverting:

  • create a gcs object separately every time open_zarr_on_gcp is run. CONCLUSION: Creating a separate gcs object is fine!
  • don't skip_instance_cache. CONCLUSION: Seems fine not to skip_instance_cache, and is maybe a little faster.
  • create Zarr stores once in main process and copy it into worker processes . CONCLUSION: fsspec throws an error saying "this is not thread safe". So need to load separately in each process. That's fine.

from predict_pv_yield.

JackKelly avatar JackKelly commented on August 29, 2024

Fixed! Some main conclusions:

1. fsspec.asyn

gcsfs 2021.4.0 (the latest version at the time of writing) works fine with PyTorch multi-process loading iff the code includes this (see this discussion for a little more context). The two lines below need to be run in every worker process (it's not sufficient to run them once in the main process):

fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None

2. Still need to read Zarr files in each process

Using gcsfs 2021.4.1, it's not possible to pass the zarr stores into each process. If you attempt to pass the zarr store into each process then fsspec throws an error saying fsspec is not thread safe.

from predict_pv_yield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.