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

Instructions from scratch in Docker #2

Open
kylemcdonald opened this issue Dec 21, 2018 · 0 comments
Open

Instructions from scratch in Docker #2

kylemcdonald opened this issue Dec 21, 2018 · 0 comments

Comments

@kylemcdonald
Copy link

kylemcdonald commented Dec 21, 2018

I started with a Docker image that had conda, cuda and pytorch preinstalled. I had to downgrade the pytorch version, so it might be faster to just start with an Anaconda-only Docker image. I also had to make one small change to the benchmark script.

$ git clone https://github.com/bkj/auction-lap.git && cd auction-lap
$ docker run --runtime=nvidia -it --rm --mount type=bind,src="$(pwd)",dst=/mnt anibali/pytorch:cuda-9.1 bash
# conda install pytorch==0.3.1 -c pytorch -y
# cd /mnt
# sudo apt update && sudo apt install -y build-essential
# pip install -r requirements.txt
# python benchmark.py --max-entry 1000 --eps 100 | tee results-1000-approx.jl
{"max_entry": 1000, "dim": 1000, "eps": 100.0, "gat_score": 997918, "src_score": 997918, "auc_gpu_score": 995778, "gat_time": 0.015303611755371094, "src_time": 0.015269994735717773, "auc_gpu_time": 0.009377479553222656}
{"max_entry": 1000, "dim": 2000, "eps": 100.0, "gat_score": 1997270, "src_score": 1997270, "auc_gpu_score": 1994676, "gat_time": 0.07352685928344727, "src_time": 0.07250046730041504, "auc_gpu_time": 0.01680469512939453}
{"max_entry": 1000, "dim": 3000, "eps": 100.0, "gat_score": 2996631, "src_score": 2996631, "auc_gpu_score": 2993748, "gat_time": 0.20714282989501953, "src_time": 0.227341890335083, "auc_gpu_time": 0.019696950912475586}
{"max_entry": 1000, "dim": 4000, "eps": 100.0, "gat_score": 3995860, "src_score": 3995860, "auc_gpu_score": 3992263, "gat_time": 0.36600685119628906, "src_time": 0.4125962257385254, "auc_gpu_time": 0.036045074462890625}
{"max_entry": 1000, "dim": 5000, "eps": 100.0, "gat_score": 4994927, "src_score": 4994927, "auc_gpu_score": 4991027, "gat_time": 0.5070977210998535, "src_time": 0.5707781314849854, "auc_gpu_time": 0.057653188705444336}
{"max_entry": 1000, "dim": 6000, "eps": 100.0, "gat_score": 5993973, "src_score": 5993973, "auc_gpu_score": 5989808, "gat_time": 0.6040315628051758, "src_time": 0.7091362476348877, "auc_gpu_time": 0.07340669631958008}
{"max_entry": 1000, "dim": 7000, "eps": 100.0, "gat_score": 6992986, "src_score": 6992986, "auc_gpu_score": 6989354, "gat_time": 0.7249176502227783, "src_time": 0.8651707172393799, "auc_gpu_time": 0.0954732894897461}
{"max_entry": 1000, "dim": 8000, "eps": 100.0, "gat_score": 7991996, "src_score": 7991996, "auc_gpu_score": 7988295, "gat_time": 0.8422048091888428, "src_time": 1.1722643375396729, "auc_gpu_time": 0.10980439186096191}
{"max_entry": 1000, "dim": 9000, "eps": 100.0, "gat_score": 8990999, "src_score": 8990999, "auc_gpu_score": 8987232, "gat_time": 1.0558438301086426, "src_time": 1.3648254871368408, "auc_gpu_time": 0.13532614707946777}
{"max_entry": 1000, "dim": 10000, "eps": 100.0, "gat_score": 9990000, "src_score": 9990000, "auc_gpu_score": 9986504, "gat_time": 1.2002484798431396, "src_time": 1.620683193206787, "auc_gpu_time": 0.1632983684539795}

If you don't downgrade pytorch, there seem to be some problems with the latest version:

# python benchmark.py --max-entry 1000 --eps 100 | tee results-1000-approx.jl
Traceback (most recent call last):
  File "benchmark.py", line 57, in <module>
    auc_cpu_score, auc_cpu_ass, _ = auction_lap(Xt_cpu, eps=None) # Score is accurate to within n * eps
  File "/mnt/auction-lap/auction_lap.py", line 54, in auction_lap
    src=bid_increments.view(-1, 1)
RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)

I think this bug can be fixed by changing this line to unassigned = (curr_ass == -1).nonzero().squeeze(dim=1) (i.e., adding dim=1).

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

No branches or pull requests

1 participant