What is a good work flow to use in order to minimize cost?


Wonderful resources, many thanks in advance!

I am working my way through the homework for lesson 1 and am wondering if someone has any good ideas on workflow to minimize AWS-cost?


  1. Write the bulk of all code on my local machine. Use sample-folder to check that everything runs. When it is time to use training-folder, then switch over to P2 AWS.
    One problem, if I try to do this is that I do not have the exact configuration for jupyter notebook (libraries, maybe some other settings?)

  2. Same as before, but write the bulk of all code on AWS T2 and then switch.

  3. write everything on p2.

Would be instructive to hear how you guys do it.

@gnak you can use Docker: work with it locally and then upload to P2 or any other host. As an option through AWS Elastic Container Registry.

I recommend also pricing the time you spend into the cost :wink:

Basically how much extra time (and mistakes => more extra time) will it cause to have a non-straightforward workflow? For example, you have a bug in your script copying the code, and run the wrong code for one night? Costs:

  • wasted AWS GPU time
  • wasted mental energy figuring out what’s wrong (that is IF you notice it)
  • wasted time and energy fixing and redoing, which could have been used to learn DL faster

I thought about this and in the end decided on building my own box. There is a larger up front cost of setting it up, but then the marginal cost per GPU time goes to near zero. And the workflow on my box is as simple as can be, just code and run!

1 Like

@tensoralex, that sounds like a good idea. Do you happen to know of any resources that will set me up as smoothly as possible? I’ve only heard of Dockers but never actually used it.

EDIT: I think Ready to use cross-platform environment for the course is a good resource for that.

@msp, I have studied quite a bit of economics and have a decent idea of how to go about thinking about costs =p How did you go about setting up your own box?


I would be interested about an economically formalized approach to this! I am often confronted with similar decisions, trading off time vs money, taking into account friction, and I am usually unsure how to put it into some sort of an equation.

To build my own server, I read the very useful thread here: Making your own server
I then settled on a parts list by using pcpartpicker: https://pcpartpicker.com/list/kxWVXH
Software-wise, I set up Ubuntu 16.04, and installed all the python modules in dedicated Anaconda environments (one per course since they use different versions), which has been extremely smooth so far.

@gnak you can try to explore Crestle or Floydhub if you need fast setup, both are represented on this forum…

Oh wow, judging by your reasoning I would have guessed that you had at least some economics training!
Here is a decent exposition: https://sites.hks.harvard.edu/fs/gborjas/publications/books/LE/LEMath.pdf. There you can find some terminology so look somewhere else for intuition (or think for yourself). If you are interested in practical use, then intuition is probably more relevant.

The general idea of how Time (Leisure) vs Money (Consumption) is modelled: An individual chooses between buying leisure and all other goods. What is the cost of leisure? Well… as the cost of all things, it is the opportunity cost. What is the opportunity cost? If the individual chooses one hour of leisure, it is assumed, he/she could instead work that hour. So the opportunity cost is the wage.

So what happens if an individual gets a wage raise? On the one hand, He/she has will get an increased income, and hence can afford to buy more leisure. But on the other hand, since the wage is the price of leisure, leisure has also become more expensive! It is ambiguous from the given information. Information about the individuals preferences is sufficient to answer the question.

When it comes to taking friction into account, usually economists start the analysis from the premise of a frictionless world. This simplifies the analysis of the problem and gets the essence of the mechanisms at play. It becomes easier to think about frictions on top of the frictionless framework.

Very cool to build your own server. I think that is a bit too complex for me to do for me at this point but hopefully in the future =)

Will definitely check it out.

Many thanks!