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

Added Dockerfile #21

Merged
merged 8 commits into from
Aug 19, 2024
Merged

Added Dockerfile #21

merged 8 commits into from
Aug 19, 2024

Conversation

t46
Copy link
Contributor

@t46 t46 commented Aug 14, 2024

I've added a Dockerfile. However, there's no specific need for this file - I just thought having a Dockerfile might be convenient.Since installing texlive took a long time for me, I used a texlive-based image for now, but I'm not sure if that's the best approach. Also, I'm not certain if the RUN commands I included are desirable. If there's a better way to write the file, please feel free to use that instead.

I've also created a docker image for reference:
https://hub.docker.com/repository/docker/t4646/ai-scientist/general

NOTE: I uploaded the newer version

@t46
Copy link
Contributor Author

t46 commented Aug 16, 2024

I updated the Dorckerfile. This is now dependent on python:3.11-bullseye image.

I also uploaded the docker image based on this file. This image do all in readme except for nanogpt&lite setup and api key setting. so you can run
python launch_scientist.py --model "gpt-4o-2024-05-13" --experiment 2d_diffusion --num-ideas 2
for example.

@JGalego
Copy link
Contributor

JGalego commented Aug 16, 2024

Just a few recommendations from an outsider:

  • Check your Dockerfile against a good linter e.g. Hadolint
  • Consider adding an entrypoint script for the image so that running launch_scientist.py is as easy as
    docker run sakana-ai/ai-scientist \
       -e OPENAI_API_KEY=$OPENAI_API_KEY \
       --model "gpt-4o-2024-05-13" \
       --experiment 2d_diffusion \
       --num-ideas 2
  • A word to the owners: how can we bring the image size down (currently at ~6GB)? Is texlive-full really necessary?

@JacquesGariepy JacquesGariepy mentioned this pull request Aug 16, 2024
@t46
Copy link
Contributor Author

t46 commented Aug 17, 2024

I've largely incorporated the points @JGalego pointed out, except for using texlive-full and ignoring some of the linter's suggestions (using cd in a loop).

  • Check the Dockerfile against Hadolint
  • Add entrypoint script to run launch_scientist.py

The image is here:
https://hub.docker.com/layers/t4646/ai-scientist/20240817/images/sha256-1a10dccad33cbf1f25f07cd34f080d37fe6e16eb0933fd3915cf7f40116a73bf?context=repo

You can use this image like this:
[endpoint script]

docker run -e OPENAI_API_KEY=$OPENAI_API_KEY t4646/ai-scientist:20240817 \
       --model “gpt-4o-2024-05-13” \
       --experiment 2d_diffusion \
       --num-ideas 1

[interactive]

docker run -it -e OPENAI_API_KEY=$OPENAI_API_KEY \
  --entrypoint /bin/bash \
  t4646/ai-scientist:20240817

@curiosityz
Copy link

TeLive Full eats up all the space when trying to run this on Google Project IdX an Github Codespaces

@conglu1997 conglu1997 merged commit 15d9736 into SakanaAI:main Aug 19, 2024
@conglu1997
Copy link
Collaborator

Thank you for your contribution! Indeed, something more lightweight than texlive-full would be excellent and something that would be greatly appreciated!

@curiosityz
Copy link

I keep getting NVIDIA CUDA errors what I need to install, I get it on all the places I've tried to install also locally

@conglu1997
Copy link
Collaborator

What version is your CUDA driver?

@dmvieira
Copy link

If you want to save your running results need this command:

docker run -e OPENAI_API_KEY=$OPENAI_API_KEY -v `pwd`/templates:/app/AI-Scientist/templates t4646/ai-scientist:20240817 \
       --model gpt-4o-2024-05-13 \
       --experiment 2d_diffusion \
       --num-ideas 1

It will be inside templates/2d_diffusion/run_* folder

@conglu1997
Copy link
Collaborator

Thanks, changed! :)

@callor
Copy link

callor commented Sep 3, 2024

Thank you very much
I tried to run it locally in a windows environment, but it didn't work, so I'm running it in a docker environment.
There are some errors during the execution process, but
I'm curious about how to set the API key for https://www.semanticscholar.org/

@callor
Copy link

callor commented Sep 3, 2024

In interactive environment, I still get CUDA Disable related errors during model training. I don't know why.

@aaronmandell
Copy link

Any folks interested/willing to help integrate AIScientist into a DeSci DAO, please DM.

@callor
Copy link

callor commented Sep 8, 2024

Hello Dear
During the Docker execution process, it keeps stopping, leaving only the following log. What could be the problem?

System : Windows 11 x64
GPU : RTX A2000
Memory : 32GB

Please Help Me!!

shell command

docker run -d --gpus all --env-file=/app/ai-project/.env -v "/$(pwd)/templates:/app/ai-project/AI-Scientist/templa
tes" t4646/ai-scientist:20240817 --model gpt-4o-2024-05-13 --experiment nanoGPT --num-ideas 2

log message

2024-09-09 07:57:20 Response Status Code: 200
2024-09-09 07:57:20 Response Content: {"total": 12, "offset": 0, "next": 10, "data": [{"paperId": "910aea4a020c329afb8b8a948abaafdf9ebcab3f", "title": "DropAttention: A Regularization Method for Fully-Connected Self-Attention Networks", "abstract": "Variants dropout methods have been designed for the fully-connected layer, convolutional layer and recurrent layer in neural networks, and shown to be effective to avoid overfitting. As an appealing alternative to recurrent and convolutional layers, the fully-connected self-attention lay
2024-09-09 07:57:20 Decision made: novel after round 3
2024-09-09 07:57:20 
2024-09-09 07:57:20 Checking novelty of idea 3: adaptive_learning_rate
2024-09-09 07:57:20 Response Status Code: 200
2024-09-09 07:57:20 Response Content: {"total": 707, "offset": 0, "next": 10, "data": [{"paperId": "76488b0743c9553b7b1d7ec46afe107ea60a67ca", "title": "AutoLRS: Automatic Learning-Rate Schedule by Bayesian Optimization on the Fly", "abstract": "The learning rate (LR) schedule is one of the most important hyper-parameters needing careful tuning in training DNNs. However, it is also one of the least automated parts of machine learning systems and usually costs significant manual effort and computing. Though there are pre-defined LR s
2024-09-09 07:57:20 Response Status Code: 200
2024-09-09 07:57:20 Response Content: {"total": 53, "offset": 0, "next": 10, "data": [{"paperId": "8508a2660777b2cf9130530f690f58896b61bdf8", "title": "A Cascade CNN Model based on Adaptive Learning Rate Thresholding for Reliable Face Recognition", "abstract": "Convolutional models may effectively identify persons quickly through automatic face analysis. A convolutional neural network architecture known as the CNN cascade structure uses numerous deep convolution layers to extract hierarchical characteristics from the input image. Ca
2024-09-09 07:57:20 Decision made: novel after round 2
2024-09-09 07:57:20 Processing idea: adaptive_block_size
2024-09-09 07:57:20 Failed to evaluate idea adaptive_block_size: [Errno 2] No such file or directory: 'templates/nanoGPT/run_0/final_info.json'
2024-09-09 07:57:20 Processing idea: attention_dropout
2024-09-09 07:57:20 Failed to evaluate idea attention_dropout: [Errno 2] No such file or directory: 'templates/nanoGPT/run_0/final_info.json'
2024-09-09 07:57:20 Processing idea: adaptive_learning_rate
2024-09-09 07:57:20 Failed to evaluate idea adaptive_learning_rate: [Errno 2] No such file or directory: 'templates/nanoGPT/run_0/final_info.json'
2024-09-09 07:57:20 All ideas evaluated.

@curiosityz
Copy link

Well look at the error....

2024-09-09 07:57:20 Failed to evaluate idea adaptive_block_size: [Errno 2] No such file or directory: 'templates/nanoGPT/run_0/final_info.json'

It sounds like they didn't build the pre-run steps into Docker. Go read the directions and run the steps it says "you need to run this first"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants