{
  "id": 18250,
  "title": "AWS usage feedback",
  "url": "/competitions/second-annual-data-science-bowl/discussion/18250",
  "author_name": "",
  "post_date": "2016-01-05T06:02:20.447Z",
  "votes": null,
  "comment_count": 13,
  "views": 2403,
  "content": "<p>Kagglers,\nI'm currently making a tutorial on using AWS cost effectively on the DSB2016. I've used AWS with spot pricing many times across many Kaggles (via frequently scp backing up work). However, I'd like to solicit your feedback on using AWS for this particular challenge so I can build a better tutorial.\nThanks,\nMike (admin)</p>",
  "messages": [
    {
      "id": "103649",
      "postDate": "01/05/2016 06:02:20",
      "content": "<p>Kagglers,\nI'm currently making a tutorial on using AWS cost effectively on the DSB2016. I've used AWS with spot pricing many times across many Kaggles (via frequently scp backing up work). However, I'd like to solicit your feedback on using AWS for this particular challenge so I can build a better tutorial.\nThanks,\nMike (admin)</p>",
      "rawMarkdown": "Kagglers,\r\nI'm currently making a tutorial on using AWS cost effectively on the DSB2016. I've used AWS with spot pricing many times across many Kaggles (via frequently scp backing up work). However, I'd like to solicit your feedback on using AWS for this particular challenge so I can build a better tutorial.\r\nThanks,\r\nMike (admin)",
      "votes": null
    },
    {
      "id": "103651",
      "postDate": "01/05/2016 06:13:55",
      "content": "<p>Maybe a tutorial of starting a MXnet docker image with CUDA can help? <a href=\"http://mxnt.ml/en/latest/build.html#docker-images\">http://mxnt.ml/en/latest/build.html#docker-images</a> Since there is a MXnet tutorial, with this preinstalled docker, people can quickly pickup the tutorial.</p>",
      "rawMarkdown": "Maybe a tutorial of starting a MXnet docker image with CUDA can help? http://mxnt.ml/en/latest/build.html#docker-images Since there is a MXnet tutorial, with this preinstalled docker, people can quickly pickup the tutorial.",
      "votes": null
    },
    {
      "id": "103696",
      "postDate": "01/05/2016 16:13:33",
      "content": "<p>@Mike Kim, That sounds like a great idea.  </p>\n\n<p>The last time I used AWS for this sort of thing was a while ago, so I forget the details, but my general strategy was:</p>\n\n<ol>\n<li>Mount a non-root volume with the do not delete flag set (I don't think root volumes can be preserved, although it's possible that has changed).</li>\n<li>Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.</li>\n</ol>\n\n<p>I don't recall the details of #1, but I don't think it's too difficult. For #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.</p>",
      "rawMarkdown": "Mike Kim, That sounds like a great idea.  \r\n\r\nThe last time I used AWS for this sort of thing was a while ago, so I forget the details, but my general strategy was:\r\n\r\n1. Mount a non-root volume with the do not delete flag set (I don't think root volumes can be preserved, although it's possible that has changed).\r\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\r\n\r\nI don't recall the details of #1, but I don't think it's too difficult. For #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.",
      "votes": null
    },
    {
      "id": "103729",
      "postDate": "01/05/2016 22:11:29",
      "content": "<p>If you are using mxnet, one thing you can do is directly work with S3 as data source and path to save data, so you won't miss anything when machine goes off, and do not need to re-process the data when you restart the machine.</p>\n\n<p>We think this can be  quite helpful, but would love to hear your feedback on this</p>",
      "rawMarkdown": "If you are using mxnet, one thing you can do is directly work with S3 as data source and path to save data, so you won't miss anything when machine goes off, and do not need to re-process the data when you restart the machine.\r\n\r\nWe think this can be  quite helpful, but would love to hear your feedback on this",
      "votes": null
    },
    {
      "id": "103842",
      "postDate": "01/07/2016 00:06:40",
      "content": "<p>So should I follow this: <a href=\"http://mxnet.readthedocs.org/en/latest/aws.html\">http://mxnet.readthedocs.org/en/latest/aws.html</a> and see if I run into any problems? I also see there's a public AMI already on AWS here: <a href=\"https://github.com/dmlc/MXNet.jl/issues/43\">https://github.com/dmlc/MXNet.jl/issues/43</a>\nAm I missing anything important here?</p>",
      "rawMarkdown": "So should I follow this: http://mxnet.readthedocs.org/en/latest/aws.html and see if I run into any problems? I also see there's a public AMI already on AWS here: https://github.com/dmlc/MXNet.jl/issues/43\r\nAm I missing anything important here?",
      "votes": null
    },
    {
      "id": "103847",
      "postDate": "01/07/2016 00:40:41",
      "content": "<p>Yes, the public AMI seems did not compile with s3 enabled, but you can easily recompile it</p>",
      "rawMarkdown": "Yes, the public AMI seems did not compile with s3 enabled, but you can easily recompile it",
      "votes": null
    },
    {
      "id": "105250",
      "postDate": "01/21/2016 12:45:40",
      "content": "<p>[quote=Tim Hochberg;103696]\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\nFor #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.</p>\n\n<p>[/quote]</p>\n\n<p>yes, please supply the code</p>",
      "rawMarkdown": "[quote=Tim Hochberg;103696]\r\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\r\nFor #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.\r\n\r\n[/quote]\r\n\r\nyes, please supply the code",
      "votes": null
    },
    {
      "id": "105275",
      "postDate": "01/21/2016 18:01:05",
      "content": "<p>once the weights are dumped on the mounted volume you can sync to an s3 bucket with the boto python library <a href=\"http://boto.cloudhackers.com/en/latest/\">http://boto.cloudhackers.com/en/latest/</a>  I use this cause I run spot instances that get terminated abruptly</p>\n\n<p>def write_model_data_s3(filename):</p>\n\n<pre><code>   s3 = boto.connect_s3()\n   key = s3.get_bucket('weights').new_key(filename)\n   key.set_contents_from_filename(filename)\n</code></pre>\n\n<p>def read_model_data_s3(model, filename):</p>\n\n<pre><code>  s3 = boto.connect_s3()\n  key = s3.get_bucket('weights').get_key(filename)\n  key.get_contents_to_filename(filename)\n</code></pre>",
      "rawMarkdown": "once the weights are dumped on the mounted volume you can sync to an s3 bucket with the boto python library http://boto.cloudhackers.com/en/latest/  I use this cause I run spot instances that get terminated abruptly\r\n\r\n\r\ndef write_model_data_s3(filename):\r\n\r\n       s3 = boto.connect_s3()\r\n       key = s3.get_bucket('weights').new_key(filename)\r\n       key.set_contents_from_filename(filename)\r\n\r\ndef read_model_data_s3(model, filename):\r\n\r\n      s3 = boto.connect_s3()\r\n      key = s3.get_bucket('weights').get_key(filename)\r\n      key.get_contents_to_filename(filename)",
      "votes": null
    },
    {
      "id": "105278",
      "postDate": "01/21/2016 18:21:47",
      "content": "<p>my current setup - after my instance got killed a few times - and had to reinstall packages (fingers crossed that this works): </p>\n\n<ul>\n<li>Launch spot instance. Uncheck the checkmark of &quot;delete on termination&quot; of the root drive. </li>\n<li>Regardless, create a seperate EBS volume to store the data, and mount this drive seperately to the instance. </li>\n<li>Download the data on the seperate EBS volume. so at least you never have to download that data-again  </li>\n<li>(install all packages) </li>\n<li>Make an image out of your current instance (in EC2 dashboard - Instances - Actions - create image). I believe that will allow one to restore the instance with all settings if it gets killed. it automatically creates a snapshot of all EBS drives as well. (the AWS language on the difference between snapshots and images is a bit confusing - but i believe (correct me if wrong) that image creation is the safest bet.</li>\n</ul>\n\n<p>To be honest - this might not be a failproof / smart setup. so please let me know where i can improve. I have not yet fully understood why S3 is superior to EBS. It seems slightly more complex to setup than to stay only in EC2, but i might be missing something.</p>\n\n<p>(maybe - as a community - we should create a (set of) public AMIs that allows other to leapfrog over the hassle of installing CUDA and other packages and drop straight into a well-functioning AMI that can be rebooted as needed) </p>",
      "rawMarkdown": "my current setup - after my instance got killed a few times - and had to reinstall packages (fingers crossed that this works): \r\n\r\n* Launch spot instance. Uncheck the checkmark of \"delete on termination\" of the root drive. \r\n* Regardless, create a seperate EBS volume to store the data, and mount this drive seperately to the instance. \r\n* Download the data on the seperate EBS volume. so at least you never have to download that data-again  \r\n* (install all packages) \r\n* Make an image out of your current instance (in EC2 dashboard - Instances - Actions - create image). I believe that will allow one to restore the instance with all settings if it gets killed. it automatically creates a snapshot of all EBS drives as well. (the AWS language on the difference between snapshots and images is a bit confusing - but i believe (correct me if wrong) that image creation is the safest bet.\r\n\r\nTo be honest - this might not be a failproof / smart setup. so please let me know where i can improve. I have not yet fully understood why S3 is superior to EBS. It seems slightly more complex to setup than to stay only in EC2, but i might be missing something.\r\n\r\n(maybe - as a community - we should create a (set of) public AMIs that allows other to leapfrog over the hassle of installing CUDA and other packages and drop straight into a well-functioning AMI that can be rebooted as needed)",
      "votes": null
    },
    {
      "id": "105282",
      "postDate": "01/21/2016 18:49:17",
      "content": "<p>@WD you can setup dropbox on your AWS and auto sync the output data directory with local directory. It is one of couple of solutions. You can also ssh-mount a local directory to AWS, and all output are sync-ed to local.</p>",
      "rawMarkdown": "WD you can setup dropbox on your AWS and auto sync the output data directory with local directory. It is one of couple of solutions. You can also ssh-mount a local directory to AWS, and all output are sync-ed to local.",
      "votes": null
    },
    {
      "id": "105326",
      "postDate": "01/22/2016 04:08:12",
      "content": "<p>@Mike Kim, such a tutorial would be helpful. Do you plan to create a public AMI that we can leverage. Thanks!</p>",
      "rawMarkdown": "Mike Kim, such a tutorial would be helpful. Do you plan to create a public AMI that we can leverage. Thanks!",
      "votes": null
    },
    {
      "id": "105328",
      "postDate": "01/22/2016 04:37:31",
      "content": "<p>@Mostafa, this assumes that you are using nolearn as well as lasagne. The dumper itself is very simple:</p>\n\n<pre><code>class WeightDumper(object):\n\n    def __init__(self, name, interval=20):\n        self.name = name\n        self.interval = interval\n\n    def __call__(self, nn, train_history):\n        current_epoch = train_history[-1]['epoch']\n        if (current_epoch % self.interval) == 0:\n            nn.save_params_to(&quot;{0}-{1}.pickle&quot;.format(self.name, current_epoch))\n</code></pre>\n\n<p>Then one would also include the following when creating your net:</p>\n\n<pre><code>net =  NeuralNet(\n    # ...\n    on_epoch_finished=[\n        WeightDumper(&quot;PATH_TO_DUMP_TO&quot;),\n        ],\n    # ...\n    )\n</code></pre>\n\n<p>That's it. Hope that helps.</p>",
      "rawMarkdown": "Mostafa, this assumes that you are using nolearn as well as lasagne. The dumper itself is very simple:\r\n\r\n    class WeightDumper(object):\r\n\r\n        def __init__(self, name, interval=20):\r\n            self.name = name\r\n            self.interval = interval\r\n\r\n        def __call__(self, nn, train_history):\r\n            current_epoch = train_history[-1]['epoch']\r\n            if (current_epoch % self.interval) == 0:\r\n                nn.save_params_to(\"{0}-{1}.pickle\".format(self.name, current_epoch))\r\n\r\nThen one would also include the following when creating your net:\r\n\r\n    net =  NeuralNet(\r\n        # ...\r\n        on_epoch_finished=[\r\n            WeightDumper(\"PATH_TO_DUMP_TO\"),\r\n            ],\r\n        # ...\r\n        )\r\n\r\nThat's it. Hope that helps.",
      "votes": null
    },
    {
      "id": "105532",
      "postDate": "01/24/2016 08:26:24",
      "content": "<p>Noob question. let's assume one  has an AWS instance with 8 cpus and 1 gpu. I believe that one can open multiple putty/terminal windows/sessions on the same instance. Is there any benefit in doing so? Or is it the case that if I open another putty session to do some file indexing while the main sesssion is e.g. proprocessing, then the result is that they run in parallel, but that the preprocessing will now go a bit slower? </p>",
      "rawMarkdown": "Noob question. let's assume one  has an AWS instance with 8 cpus and 1 gpu. I believe that one can open multiple putty/terminal windows/sessions on the same instance. Is there any benefit in doing so? Or is it the case that if I open another putty session to do some file indexing while the main sesssion is e.g. proprocessing, then the result is that they run in parallel, but that the preprocessing will now go a bit slower?",
      "votes": null
    },
    {
      "id": "105533",
      "postDate": "01/24/2016 10:22:04",
      "content": "<p>Hi Mike,\nI would be very interested in this, but please could it be more platform-independent than just Mxnet? Thanks,</p>",
      "rawMarkdown": "Hi Mike,\r\nI would be very interested in this, but please could it be more platform-independent than just Mxnet? Thanks,",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 103651,
      "author_name": "phunter",
      "author_url": "",
      "post_date": "01/05/2016 06:13:55",
      "content": "<p>Maybe a tutorial of starting a MXnet docker image with CUDA can help? <a href=\"http://mxnt.ml/en/latest/build.html#docker-images\">http://mxnt.ml/en/latest/build.html#docker-images</a> Since there is a MXnet tutorial, with this preinstalled docker, people can quickly pickup the tutorial.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 103696,
      "author_name": "bitsofbits",
      "author_url": "",
      "post_date": "01/05/2016 16:13:33",
      "content": "<p>@Mike Kim, That sounds like a great idea.  </p>\n\n<p>The last time I used AWS for this sort of thing was a while ago, so I forget the details, but my general strategy was:</p>\n\n<ol>\n<li>Mount a non-root volume with the do not delete flag set (I don't think root volumes can be preserved, although it's possible that has changed).</li>\n<li>Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.</li>\n</ol>\n\n<p>I don't recall the details of #1, but I don't think it's too difficult. For #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 103729,
      "author_name": "tqchen",
      "author_url": "",
      "post_date": "01/05/2016 22:11:29",
      "content": "<p>If you are using mxnet, one thing you can do is directly work with S3 as data source and path to save data, so you won't miss anything when machine goes off, and do not need to re-process the data when you restart the machine.</p>\n\n<p>We think this can be  quite helpful, but would love to hear your feedback on this</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 103842,
      "author_name": "mikeskim",
      "author_url": "",
      "post_date": "01/07/2016 00:06:40",
      "content": "<p>So should I follow this: <a href=\"http://mxnet.readthedocs.org/en/latest/aws.html\">http://mxnet.readthedocs.org/en/latest/aws.html</a> and see if I run into any problems? I also see there's a public AMI already on AWS here: <a href=\"https://github.com/dmlc/MXNet.jl/issues/43\">https://github.com/dmlc/MXNet.jl/issues/43</a>\nAm I missing anything important here?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 103847,
      "author_name": "tqchen",
      "author_url": "",
      "post_date": "01/07/2016 00:40:41",
      "content": "<p>Yes, the public AMI seems did not compile with s3 enabled, but you can easily recompile it</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105250,
      "author_name": "mostafafr",
      "author_url": "",
      "post_date": "01/21/2016 12:45:40",
      "content": "<p>[quote=Tim Hochberg;103696]\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\nFor #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.</p>\n\n<p>[/quote]</p>\n\n<p>yes, please supply the code</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105275,
      "author_name": "godaibo",
      "author_url": "",
      "post_date": "01/21/2016 18:01:05",
      "content": "<p>once the weights are dumped on the mounted volume you can sync to an s3 bucket with the boto python library <a href=\"http://boto.cloudhackers.com/en/latest/\">http://boto.cloudhackers.com/en/latest/</a>  I use this cause I run spot instances that get terminated abruptly</p>\n\n<p>def write_model_data_s3(filename):</p>\n\n<pre><code>   s3 = boto.connect_s3()\n   key = s3.get_bucket('weights').new_key(filename)\n   key.set_contents_from_filename(filename)\n</code></pre>\n\n<p>def read_model_data_s3(model, filename):</p>\n\n<pre><code>  s3 = boto.connect_s3()\n  key = s3.get_bucket('weights').get_key(filename)\n  key.get_contents_to_filename(filename)\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105278,
      "author_name": "wouterd1",
      "author_url": "",
      "post_date": "01/21/2016 18:21:47",
      "content": "<p>my current setup - after my instance got killed a few times - and had to reinstall packages (fingers crossed that this works): </p>\n\n<ul>\n<li>Launch spot instance. Uncheck the checkmark of &quot;delete on termination&quot; of the root drive. </li>\n<li>Regardless, create a seperate EBS volume to store the data, and mount this drive seperately to the instance. </li>\n<li>Download the data on the seperate EBS volume. so at least you never have to download that data-again  </li>\n<li>(install all packages) </li>\n<li>Make an image out of your current instance (in EC2 dashboard - Instances - Actions - create image). I believe that will allow one to restore the instance with all settings if it gets killed. it automatically creates a snapshot of all EBS drives as well. (the AWS language on the difference between snapshots and images is a bit confusing - but i believe (correct me if wrong) that image creation is the safest bet.</li>\n</ul>\n\n<p>To be honest - this might not be a failproof / smart setup. so please let me know where i can improve. I have not yet fully understood why S3 is superior to EBS. It seems slightly more complex to setup than to stay only in EC2, but i might be missing something.</p>\n\n<p>(maybe - as a community - we should create a (set of) public AMIs that allows other to leapfrog over the hassle of installing CUDA and other packages and drop straight into a well-functioning AMI that can be rebooted as needed) </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105282,
      "author_name": "phunter",
      "author_url": "",
      "post_date": "01/21/2016 18:49:17",
      "content": "<p>@WD you can setup dropbox on your AWS and auto sync the output data directory with local directory. It is one of couple of solutions. You can also ssh-mount a local directory to AWS, and all output are sync-ed to local.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105326,
      "author_name": "opraveen",
      "author_url": "",
      "post_date": "01/22/2016 04:08:12",
      "content": "<p>@Mike Kim, such a tutorial would be helpful. Do you plan to create a public AMI that we can leverage. Thanks!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105328,
      "author_name": "bitsofbits",
      "author_url": "",
      "post_date": "01/22/2016 04:37:31",
      "content": "<p>@Mostafa, this assumes that you are using nolearn as well as lasagne. The dumper itself is very simple:</p>\n\n<pre><code>class WeightDumper(object):\n\n    def __init__(self, name, interval=20):\n        self.name = name\n        self.interval = interval\n\n    def __call__(self, nn, train_history):\n        current_epoch = train_history[-1]['epoch']\n        if (current_epoch % self.interval) == 0:\n            nn.save_params_to(&quot;{0}-{1}.pickle&quot;.format(self.name, current_epoch))\n</code></pre>\n\n<p>Then one would also include the following when creating your net:</p>\n\n<pre><code>net =  NeuralNet(\n    # ...\n    on_epoch_finished=[\n        WeightDumper(&quot;PATH_TO_DUMP_TO&quot;),\n        ],\n    # ...\n    )\n</code></pre>\n\n<p>That's it. Hope that helps.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105532,
      "author_name": "wouterd1",
      "author_url": "",
      "post_date": "01/24/2016 08:26:24",
      "content": "<p>Noob question. let's assume one  has an AWS instance with 8 cpus and 1 gpu. I believe that one can open multiple putty/terminal windows/sessions on the same instance. Is there any benefit in doing so? Or is it the case that if I open another putty session to do some file indexing while the main sesssion is e.g. proprocessing, then the result is that they run in parallel, but that the preprocessing will now go a bit slower? </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105533,
      "author_name": "eoghanf",
      "author_url": "",
      "post_date": "01/24/2016 10:22:04",
      "content": "<p>Hi Mike,\nI would be very interested in this, but please could it be more platform-independent than just Mxnet? Thanks,</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "103649": "Kagglers,\r\nI'm currently making a tutorial on using AWS cost effectively on the DSB2016. I've used AWS with spot pricing many times across many Kaggles (via frequently scp backing up work). However, I'd like to solicit your feedback on using AWS for this particular challenge so I can build a better tutorial.\r\nThanks,\r\nMike (admin)",
    "103651": "Maybe a tutorial of starting a MXnet docker image with CUDA can help? http://mxnt.ml/en/latest/build.html#docker-images Since there is a MXnet tutorial, with this preinstalled docker, people can quickly pickup the tutorial.",
    "103696": "Mike Kim, That sounds like a great idea.  \r\n\r\nThe last time I used AWS for this sort of thing was a while ago, so I forget the details, but my general strategy was:\r\n\r\n1. Mount a non-root volume with the do not delete flag set (I don't think root volumes can be preserved, although it's possible that has changed).\r\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\r\n\r\nI don't recall the details of #1, but I don't think it's too difficult. For #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.",
    "103729": "If you are using mxnet, one thing you can do is directly work with S3 as data source and path to save data, so you won't miss anything when machine goes off, and do not need to re-process the data when you restart the machine.\r\n\r\nWe think this can be  quite helpful, but would love to hear your feedback on this",
    "103842": "So should I follow this: http://mxnet.readthedocs.org/en/latest/aws.html and see if I run into any problems? I also see there's a public AMI already on AWS here: https://github.com/dmlc/MXNet.jl/issues/43\r\nAm I missing anything important here?",
    "103847": "Yes, the public AMI seems did not compile with s3 enabled, but you can easily recompile it",
    "105250": "[quote=Tim Hochberg;103696]\r\n2. Setup my neural net code so that it dumped out the weights every 20 epochs or so to the mounted volume.\r\nFor #2, I have code setup to do that automatically in Lasagne, but in this contest most people are using mxNet, so I'm not sure if the code itself would be useful.  However, I'm happy to supply it if you like.\r\n\r\n[/quote]\r\n\r\nyes, please supply the code",
    "105275": "once the weights are dumped on the mounted volume you can sync to an s3 bucket with the boto python library http://boto.cloudhackers.com/en/latest/  I use this cause I run spot instances that get terminated abruptly\r\n\r\n\r\ndef write_model_data_s3(filename):\r\n\r\n       s3 = boto.connect_s3()\r\n       key = s3.get_bucket('weights').new_key(filename)\r\n       key.set_contents_from_filename(filename)\r\n\r\ndef read_model_data_s3(model, filename):\r\n\r\n      s3 = boto.connect_s3()\r\n      key = s3.get_bucket('weights').get_key(filename)\r\n      key.get_contents_to_filename(filename)",
    "105278": "my current setup - after my instance got killed a few times - and had to reinstall packages (fingers crossed that this works): \r\n\r\n* Launch spot instance. Uncheck the checkmark of \"delete on termination\" of the root drive. \r\n* Regardless, create a seperate EBS volume to store the data, and mount this drive seperately to the instance. \r\n* Download the data on the seperate EBS volume. so at least you never have to download that data-again  \r\n* (install all packages) \r\n* Make an image out of your current instance (in EC2 dashboard - Instances - Actions - create image). I believe that will allow one to restore the instance with all settings if it gets killed. it automatically creates a snapshot of all EBS drives as well. (the AWS language on the difference between snapshots and images is a bit confusing - but i believe (correct me if wrong) that image creation is the safest bet.\r\n\r\nTo be honest - this might not be a failproof / smart setup. so please let me know where i can improve. I have not yet fully understood why S3 is superior to EBS. It seems slightly more complex to setup than to stay only in EC2, but i might be missing something.\r\n\r\n(maybe - as a community - we should create a (set of) public AMIs that allows other to leapfrog over the hassle of installing CUDA and other packages and drop straight into a well-functioning AMI that can be rebooted as needed)",
    "105282": "WD you can setup dropbox on your AWS and auto sync the output data directory with local directory. It is one of couple of solutions. You can also ssh-mount a local directory to AWS, and all output are sync-ed to local.",
    "105326": "Mike Kim, such a tutorial would be helpful. Do you plan to create a public AMI that we can leverage. Thanks!",
    "105328": "Mostafa, this assumes that you are using nolearn as well as lasagne. The dumper itself is very simple:\r\n\r\n    class WeightDumper(object):\r\n\r\n        def __init__(self, name, interval=20):\r\n            self.name = name\r\n            self.interval = interval\r\n\r\n        def __call__(self, nn, train_history):\r\n            current_epoch = train_history[-1]['epoch']\r\n            if (current_epoch % self.interval) == 0:\r\n                nn.save_params_to(\"{0}-{1}.pickle\".format(self.name, current_epoch))\r\n\r\nThen one would also include the following when creating your net:\r\n\r\n    net =  NeuralNet(\r\n        # ...\r\n        on_epoch_finished=[\r\n            WeightDumper(\"PATH_TO_DUMP_TO\"),\r\n            ],\r\n        # ...\r\n        )\r\n\r\nThat's it. Hope that helps.",
    "105532": "Noob question. let's assume one  has an AWS instance with 8 cpus and 1 gpu. I believe that one can open multiple putty/terminal windows/sessions on the same instance. Is there any benefit in doing so? Or is it the case that if I open another putty session to do some file indexing while the main sesssion is e.g. proprocessing, then the result is that they run in parallel, but that the preprocessing will now go a bit slower?",
    "105533": "Hi Mike,\r\nI would be very interested in this, but please could it be more platform-independent than just Mxnet? Thanks,"
  },
  "source": "meta"
}