<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Stephan,
<div class=""><br class="">
</div>
<div class="">Just a quick follow-up on that: training and translation seem to work fine, I’ll prepare some example scripts as I’ve done for HNMT. I’ve seen that you have put the scripts mentioned below into a scripts directory - would it be possible to add
 this directory to PATH when loading the module?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Yves<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 26 Sep 2018, at 10:59, Scherrer, Yves <<a href="mailto:yves.scherrer@helsinki.fi" class="">yves.scherrer@helsinki.fi</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div lang="EN-US" link="blue" vlink="#954F72" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div class="x_WordSection1">
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Hi,</div>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I’ve had a quick look at Stephan’s OpenNMT-py on Abel. The onmt module seems to work, but one generally uses the scripts “preprocess.py”, “train.py” and “translate.py” (at the root directory of the Github repo), and these scripts seem to be missing from the
 module. Would it be possible to copy these three scripts (there is a fourth one, “server.py”, but this one might not be relevant for common usage) somewhere inside the virtual environment, so that they can be found and called easily?</div>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I have to say that I find these stacked virtual environments quite elegant. Too bad that CSC doesn’t even include the virtualenv command in their python-env modules…</div>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Best,</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Yves</div>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
</div>
<hr tabindex="-1" style="display: inline-block; width: 666.390625px;" class="">
<div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Stephan Oepen <<a href="mailto:oe@ifi.uio.no" class="">oe@ifi.uio.no</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, September 20, 2018 12:31:58 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>Scherrer, Yves<br class="">
<b class="">Cc:</b><span class="Apple-converted-space"> </span>Martin Matthiesen; infrastructure<br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [NLPL Task Force (A)] OpenNMT installation for NLPL (on Abel)</font>
<div class=""> </div>
</div>
</div>
<font size="2" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-size: 11pt;" class="">
<div class="PlainText">dear all,<br class="">
<br class="">
yes, chaining virtual environments appears to work as one would<br class="">
expect.  i might in fact have managed to install OpenNMT-py on Abel,<br class="">
using my new PyTorch 0.4.1 virtual environment, essentially:<br class="">
<br class="">
module load nlpl-pytorch<br class="">
/projects/nlpl/software/opennmt-py/<br class="">
virtualenv /projects/nlpl/software/opennmt-py/0.2.1<br class="">
<br class="">
at this point, i had to manually change the ‘python’, ‘python3’, and<br class="">
‘python3.5’ files in the new ‘bin/’ directory, to avail themselves of<br class="">
the custom glibc; see<br class="">
‘<a href="http://wiki.nlpl.eu/index.php/Infrastructure/software/glibc’" class="">http://wiki.nlpl.eu/index.php/Infrastructure/software/glibc’</a>.<br class="">
<br class="">
cd /projects/nlpl/software/modulefiles<br class="">
mkdir nlpl-opennmt-py<br class="">
cp nlpl-pytorch/0.4.1 nlpl-opennmt-py/0.2.1<br class="">
vi nlpl-opennmt-py/0.2.1<br class="">
<br class="">
cd ~/src/nlpl<br class="">
module purge<br class="">
module load nlpl-opennmt-py<br class="">
wget<span class="Apple-converted-space"> </span><a href="https://github.com/OpenNMT/OpenNMT-py/archive/0.2.1.tar.gz" class="">https://github.com/OpenNMT/OpenNMT-py/archive/0.2.1.tar.gz</a><br class="">
tar zpSxvf 0.2.1.tar.gz<br class="">
cd OpenNMT-py-0.2.1<br class="">
python setup.py install<br class="">
<br class="">
so far, my testing is limited to<br class="">
<br class="">
python -c "import torch; import onmt; print(onmt.__version__);"<br class="">
<br class="">
yves, would you maybe have a chance next week to see whether this<br class="">
installation appears healthy to you?<br class="">
<br class="">
cheers, oe<br class="">
<br class="">
<br class="">
On Wed, Sep 19, 2018 at 1:12 PM, Scherrer, Yves<br class="">
<<a href="mailto:yves.scherrer@helsinki.fi" class="">yves.scherrer@helsinki.fi</a>> wrote:<br class="">
> Hi Stephan, Martin,<br class="">
><br class="">
><br class="">
><br class="">
> I’m catching up on this thread… A few questions from my side:<br class="">
><br class="">
><br class="">
><br class="">
> Regarding Martin’s latest suggestion: that seems indeed to work fine,<br class="">
> although with the exact same commands I get a different version of PyTorch:<br class="">
><br class="">
>>>> import torch<br class="">
><br class="">
>>>> torch.__file__<br class="">
><br class="">
> '/appl/opt/python/intelpython36-2018.3/intelpython3/lib/python3.6/site-packages/torch/__init__.py'<br class="">
><br class="">
>>>> torch.__version__<br class="">
><br class="">
> '0.4.0a0+3749c58'<br class="">
><br class="">
><br class="">
><br class="">
> In any case, if PyTorch is already installed in some Python distribution,<br class="">
> that would make setting up a specific OpenNMT module rather easy. If not,<br class="">
> virtual environments should work as well (the tricky thing is mainly to<br class="">
> figure out which python versions play well with CUDA…)<br class="">
><br class="">
><br class="">
><br class="">
> Regarding Stephan’s suggestion of virtual environments: do you know if<br class="">
> virtual environments can be “stacked”, i.e. whether I could create an<br class="">
> OpenNMT virtual environment that lies on top of your PyTorch environment? Or<br class="">
> would I have to re-install another instance of PyTorch in the OpenNMT<br class="">
> virtualenv?<br class="">
><br class="">
><br class="">
><br class="">
> I’ll be travelling for the rest of the week, but will try to have a closer<br class="">
> look at these options next week.<br class="">
><br class="">
><br class="">
><br class="">
> Best,<br class="">
><br class="">
> Yves<br class="">
><br class="">
><br class="">
><br class="">
> ________________________________<br class="">
> From: Martin Matthiesen <<a href="mailto:martin.matthiesen@csc.fi" class="">martin.matthiesen@csc.fi</a>><br class="">
> Sent: Wednesday, September 19, 2018 1:29:35 PM<br class="">
> To: Stephan Oepen<br class="">
> Cc: infrastructure; Scherrer, Yves<br class="">
><br class="">
> Subject: Re: [NLPL Task Force (A)] OpenNMT installation for NLPL (on Abel)<br class="">
><br class="">
> Hello Stephan,<br class="">
><br class="">
> ----- Original Message -----<br class="">
>> From: "Stephan Oepen" <<a href="mailto:oe@ifi.uio.no" class="">oe@ifi.uio.no</a>><br class="">
>> To: "Martin Matthiesen" <<a href="mailto:martin.matthiesen@csc.fi" class="">martin.matthiesen@csc.fi</a>><br class="">
>> Cc: "infrastructure" <<a href="mailto:infrastructure@nlpl.eu" class="">infrastructure@nlpl.eu</a>>, "Yves Scherrer"<br class="">
>> <<a href="mailto:yves.scherrer@helsinki.fi" class="">yves.scherrer@helsinki.fi</a>><br class="">
>> Sent: Tuesday, 18 September, 2018 14:13:53<br class="">
>> Subject: Re: [NLPL Task Force (A)] OpenNMT installation for NLPL (on Abel)<br class="">
><br class="">
>> sorry, i was the one who had introduced the confusion about mailing<br class="">
>> lists.  there is no ‘<a href="mailto:translation@nlpl.eu" class="">translation@nlpl.eu</a>’ currently, and upon<br class="">
>> consultation with joerg there appears not to be a great need for it<br class="">
>> either (once i get around to documenting the task force structure on<br class="">
>> the project wiki, i might want to create that list nevertheless).<br class="">
>><br class="">
>> i am adding yves to thread now, so he at least has a chance of knowing<br class="">
>> what we are talking about :-).<br class="">
><br class="">
> Ok!<br class="">
>><br class="">
>> martin, i doubt that an installation of OpenNMT that requires everyone<br class="">
>> to ‘pip install --user’ into their home directory will be a good<br class="">
>> solution.  that way, the getting started instructions will be more<br class="">
>> complex, and we lack control over which version of PyTorch gets<br class="">
>> installed at the time the user actually runs the command.  my<br class="">
>> immediate reaction at least is that NLPL-supported software should be<br class="">
>> ‘self-contained’, in the sense of not depending on software components<br class="">
>> maintained by the user.<br class="">
><br class="">
> Ok, I understand.<br class="">
>><br class="">
>> what i am doing increasingly on abel is deriving virtual environments;<br class="">
>> e.g. my PyTorch installation (for NLPL) straightforwardly builds on<br class="">
>> the USIT-maintained python 3.5.  i suppose we should be able to do the<br class="">
>> same thing on taito, i.e. create ‘nlpl-pytorch’ as a virtual<br class="">
>> environment that includes the precompiled PyTorch wheel from your CSC<br class="">
>> colleagues?<br class="">
><br class="">
> Yes, I guess that is the only sensible solution to not lose track<br class="">
> completely. In the meantime, how would this work for you all:<br class="">
><br class="">
> [GPU-Env ~]$ module load python-env/intelpython3.6-2018.3<br class="">
> Loading application Intel Distribution for Python 2018 update 3<br class="">
> [GPU-Env ~]$ module list<br class="">
><br class="">
> Currently Loaded Modules:<br class="">
>   1) gcc/4.9.3   2) cuda/7.5   3) StdEnv   4) git/2.17.1   5)<br class="">
> python-env/intelpython3.6-2018.3<br class="">
><br class="">
> [GPU-Env ~]$ python3<br class="">
> Python 3.6.3 |Intel Corporation| (default, May  4 2018, 04:22:28)<br class="">
> [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux<br class="">
> Type "help", "copyright", "credits" or "license" for more information.<br class="">
> Intel(R) Distribution for Python is brought to you by Intel Corporation.<br class="">
> Please check out:<span class="Apple-converted-space"> </span><a href="https://software.intel.com/en-us/python-distribution" class="">https://software.intel.com/en-us/python-distribution</a><br class="">
>>>> import torch<br class="">
>>>> torch.__version__<br class="">
> '0.4.1'<br class="">
><br class="">
> Kudos to my colleagues Markus and Jarmo here.<br class="">
><br class="">
> Martin<br class="">
><br class="">
>><br class="">
>> oe<br class="">
>><br class="">
>><br class="">
>><br class="">
>><br class="">
>> On Mon, Sep 17, 2018 at 5:06 PM, Martin Matthiesen<br class="">
>> <<a href="mailto:martin.matthiesen@csc.fi" class="">martin.matthiesen@csc.fi</a>> wrote:<br class="">
>>> Hello,<br class="">
>>><br class="">
>>> We already have a way to use pytorch 0.4.1 on Taito-GPU:<br class="">
>>><br class="">
>>> module load python-env/intelpython3.6-2018.3<br class="">
>>> [GPU-Env ~]$ pip install -v --user<br class="">
>>> /appl/opt/pytorch/0.4.1/cu90/torch-0.4.1-cp36-cp36m-linux_x86_64.whl<br class="">
>>><br class="">
>>> One of my colleagues has compiled the module. Note that the module needs<br class="">
>>> python<br class="">
>>> 3.6 to work, the highest available on Taito-GPU.<br class="">
>>><br class="">
>>> Before I investigate CPU-support or support for other compilers, would<br class="">
>>> this<br class="">
>>> pip-approach work for you?<br class="">
>>><br class="">
>>> Regards,<br class="">
>>> Martin<br class="">
>>><br class="">
>>> ----- Original Message -----<br class="">
>>>> From: "Stephan Oepen" <<a href="mailto:oe@ifi.uio.no" class="">oe@ifi.uio.no</a>><br class="">
>>>> To: <a href="mailto:translation@nlpl.eu" class="">translation@nlpl.eu</a><br class="">
>>>> Cc: "infrastructure" <<a href="mailto:infrastructure@nlpl.eu" class="">infrastructure@nlpl.eu</a>><br class="">
>>>> Sent: Saturday, 15 September, 2018 18:59:29<br class="">
>>>> Subject: [NLPL Task Force (A)] OpenNMT installation for NLPL (on Abel)<br class="">
>>><br class="">
>>>> colleagues,<br class="">
>>>><br class="">
>>>> joerg, martin, and i talked about getting the new release version of<br class="">
>>>> OpenNMT installed for NLPL.  it appears it requires the most recent<br class="">
>>>> version of PyTorch, which currently is not available on Taito.  martin<br class="">
>>>> will ask for it to be installed by CSC.<br class="">
>>>><br class="">
>>>> in parallel, i believe i managed to put an NLPL-owned installation of<br class="">
>>>> the right PyTorch version onto Abel, please see:<br class="">
>>>><br class="">
>>>><span class="Apple-converted-space"> </span><a href="http://wiki.nlpl.eu/index.php/Infrastructure/software/pytorch" class="">http://wiki.nlpl.eu/index.php/Infrastructure/software/pytorch</a><br class="">
>>>><br class="">
>>>> before announcing this more widely, i would be grateful for some<br class="">
>>>> testing, in particular for both cpu and gpu usage.  would anyone we<br class="">
>>>> readily set up to give this a shot on Abel?<br class="">
>>>><br class="">
>>>> assuming our PyTorch is healthy, would someone from the helsinki team<br class="">
>>>> have the time to try and install OpenNMT onto Abel, e.g. as<br class="">
>>>><br class="">
>>>> /projects/nlpl/software/opennmt-py/0.2.1<br class="">
>>>><br class="">
>>>> there have been two relatively recent requests for OpenNMT in oslo<br class="">
>>>> (one of them for seq2seq dependency parsing :-), so i believe it would<br class="">
>>>> now be warranted to provide it on both systems.<br class="">
>>>><br class="">
>> >> best wishes, oe</div>
</span></font></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>