Поиск публикаций  |  Научные конференции и семинары  |  Новости науки  |  Научная сеть
Новости науки - Комментарии ученых и экспертов, мнения, научные блоги
Реклама на проекте

Что делать, если у вас "R программа считается днями" - how to do high-performance computing

Thursday, 05 November, 11:11, d-kishkinev.livejournal.com
Подписан на Facebook Group - Ecology in R здесь

https://www.facebook.com/groups/ecologyinr/

Вот вопрос от чувака.

Проблема современного интегрированного в информационную среду и digitally literate ученого типичная - условно написал R код (например у человека - код, считающий распределение видов по многим точкам), но R script выполняется часами и днями, а computing cluster или мощный компьютер недоступен. Как "бедному" ученому, студенту, без больших проблем делать high-performance computing, не имея много денег и/или большого знания в построении компьютерной инфраструктуры?

Полное обсуждение в этом фейсбучном треде здесь

Кратко идеи для тех, у кого нет времени читать, выложены здесь:

1) Найди хоть слабенький, но dedicated computer (всё равно будет считаться долго, но зато можно работать)

2) Попробуй parallelisation or parallel running instances of R running on the same machine (parallelisation for "the poor") - но, во-первых, нужно учиться как сделать параллелизацию, во-вторых, там возможны проблемы из-за нестыковок разных процессов

3) Переделать код так, чтобы всё делалось в for loop маленькими частями циклами (сделан кусок - сохранены данные - очищена environment - новый цикл). Это может процесс даже удлиннить, но увеличит вероятность того, что при "зависании" компа что-то всё же будет сделано

4) Выучить хотя бы основы high-performance computing language типа Julia и переконвертировать R script в Julia - но блин кто будет это учить? И не такое большое community у Julia по сравнению с R

5) Уйти в академический cloud
- возможно в вашем универе есть computing cluster и это самое время научиться его использовать, но возможно его нет, или он дорогой и нужно стоять в очереди
- некоторые университеты (вроде Uni of Helsinki) предоставляют кластер бесплатно

6) Пойти в коммерческий cloud

Последнее раскрыто внизу

- уйти на коммерческие платформы например в Google на Colab где есть поддержка около 40 языков включая R
https://medium.com/@dinaelhanan/an-absolute-beginners-guide-to-google-colaboratory-d55c0eb375de

- AWS (Amazon Web Services)

вот здесь чувак сделал AMI (Amazon Machine Instance - образ image для быстрого запуска в Amazon Cloud с предустановленным R  и много еще что для быстрого запуска проекта)

https://www.louisaslett.com/RStudio_AMI/?fbclid=IwAR1O31GqUqNbYDBiyw_pnTGzrQy4moWuYAcnh9oXVchDI8Bz4kLnryB376U

Вот что включено в этот RStudio AMI

What is this?

If you want to run a server in the Amazon cloud, you have to select what system you are going to bootup. This is made easy by a vast array of system images (or AMIs) which pre-pacakge a system ready for you to boot on your own custom virtual server. Many of these are simply base operating system installs, such as Debian or Ubuntu, but others add on pre-configured extra software into the image to reduce time-to-getting-stuff-done! I have created an AMI specifically targeted at R and RStudio Server with the goal of making it a 1 minute job to get going for anyone with an AWS account.

In particular, many common tools and dependencies are built-in. Features include:


  • 30GB EBS storage — compact, but enables storage of more sizeable datasets.

    • Defaults to fast SSD storage (faster, zero IO costs, only $1 per month in most regions)


  • Easy to use Dropbox integration to up/down-load files and data.

    • Setup can be completed entirely through RStudio in the web browser by running a single function.

    • Selective syncing supported so that large Dropbox accounts don’t sync everything.

    • Unlink and relink to new account supported.


  • Full LaTeX support enabling R Markdown, Sweave and regular document compiles within RStudio.

  • Java 8 JRE enabling full support for H2O and Spark.

  • GDAL dependencies for GIS packages.

  • GSL and CURL libraries.

  • Database support:

    • ODBC drivers installed.

    • RMySQL package precompiled and installed.


  • Git and Subversion support out of the box.

  • MCMC samplers:

    • Stan (RStan) installed and ready to use for Hamiltonian Monte Carlo sampling.

    • JAGS (and rjags) installed and ready to use for Gibbs sampling.

    • Greta supported for GPU MCMC sampling via Tensorflow support.


  • CUDA and cuDNN.

    • Enables immediate use of GPU instances (e.g. p2.* instances) without any setup.

    • Tensorflow and Keras deep learning libraries can be accelerated using nVidia GPUs on the GPU compute instances, just 3 lines of R code each to setup:
       # Tensorflow
       install.packages("tensorflow")
       library("tensorflow")
       install_tensorflow(version = "gpu")
      
       # Keras
       install.packages("keras")
       library("keras")
       install_keras(tensorflow = "gpu")
      


      You will then be prompted to install Miniconda: say "Yes" to this option. See the RStudio Keras page and RStudio Tensorflow page for details on using from R.

    • Also preinstalled Magma GPU linear algebra libraries for accelerated matrix decompositions.


  • Swap space for compiling of large packages on constrained memory instances (such as rugarch).

  • Arbitrary precision arithmetic and number theory libraries supported out of the box:

  • Optimised BLAS for automatically faster matrix operations than base R libraries (OpenBLAS).



Вот тьюториал как запустить R-based instance on Amazon
Brief guide on running RStudio Server's web interface on Amazon Web Services

Да, AWS машины стоят денег, но для небольших проектов это подъемная цифра (зависит от конфигурации, но речь где-то о десятках $$ в месяц, не сотни и тысячи)

Для студентов есть еще кое-какое charity - например AWS Educate дает $100 кредит для начинающих
https://aws.amazon.com/education/awseducate/

Есть еще AWS grants, но это видимо если вы будите еще обучать коллег как пользовать Amazon (типа привлекать новых клиетов Амазону)
больше инфы и application links здесь
https://aws.amazon.com/grants/
Цели их грантов
The AWS Cloud Credits for Research program (formerly AWS Research Grants) supports researchers who seek to:

  1. Build cloud-hosted publicly available science-as-a-service applications, software, or tools to facilitate their future research and the research of their community.

  2. Perform proof of concept or benchmark tests evaluating the efficacy of moving research workloads or open data sets to the cloud.

  3. Train a broader community on the usage of cloud for research workloads via workshops or tutorials.

Читать полную новость с источника 

Комментарии (0)