Error with MNIST Dataset
Hi,
I am trying to run CNTK on a system with GPUs.
The compilation and creation of data proceeded fine without any issues. After running I see this error :
cat ../Output/01_OneHidden_out_train_test.log
<<<<<<<<<<<<<<<<<<<< PROCESSED CONFIG WITH ALL VARIABLES RESOLVED <<<<<<<<<<<<<<<<<<<< command: train test precision = float CNTKModelPath: ../Output/Models/01_OneHidden CNTKCommandTrainInfo: train : 30 CNTKCommandTrainInfo: CNTKNoMoreCommands_Total : 30 CNTKCommandTrainBegin: train
[CALL STACK]
/scratch-shared/mch/scratch/dipsank/CUDNN/CNTK/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::DebugUtil::PrintCallStack() + 0xb4 ) [0x7fe97d769d44]
cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::runtime_error(char const_, ...) + 0xc0 ) [0x530140]
cntk ( Microsoft::MSR::CNTK::BestGpu::GetDevices(int, Microsoft::MSR::CNTK::BestGpuFlags) + 0x98d ) [0x7ae02d]
cntk ( Microsoft::MSR::CNTK::BestGpu::GetDevice(Microsoft::MSR::CNTK::BestGpuFlags) + 0x1a ) [0x7ae29a]
cntk ( Microsoft::MSR::CNTK::DeviceFromConfig(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x5b3 ) [0x7b1873]
cntk ( void DoTrain<Microsoft::MSR::CNTK::ConfigParameters, float>(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x4c ) [0x76117c]
cntk ( void DoCommands
EXCEPTION occurred: DeviceFromConfig: unexpected failure
Please let me know if you need additional details. Any pointers on anything I am doing wrong ?
Can you trying to set deviceId to 0 other than "auto" to select GPU manually.
I have seen this before, but I thought we fixed it. Will have a look tomorrow morning.
Thanks for reporting it!
Sent from Outlookhttp://aka.ms/Ox5hz3
On Thu, Jan 28, 2016 at 9:05 PM -0800, "Aerosoul" <[email protected]mailto:[email protected]> wrote:
Can you trying to set deviceId to 0 other than "auto" to select GPU manually.
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/55#issuecomment-176576409.
Yes setting deviceId=0 solves it for MNIST.
I also tried running CIFAR10 where I run this :
$ cntk configFile=01_Conv.config configName=01_Conv deviceId=0
And now I get this error :
Validating --> conv1_act.y = RectifiedLinear(conv1_act.p[32 x 32 x 32 x 1 x ]) -> [32 x 32 x 32 x 1 x *]
Validating --> pool1 = MaxPooling(conv1_act.y[32 x 32 x 32 x 1 x *])
[CALL STACK]
/scratch-shared/mch/scratch/dipsank/CUDNN/CNTK/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::DebugUtil::PrintCallStack() + 0xb4 ) [0x7fd7b9bdfd44]
cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::invalid_argument(char const, ...) + 0xc0 ) [0x5366d0]
cntk ( Microsoft::MSR::CNTK::PoolingNodeBase
Works fine for configFile=02_BatchNormConv.config
If I do not put the deviceId for CIFAR10 then I get the same error reported above.
Is it possible to run with multiple GPUs using only cntk ? Or do I have to use MPI to launch cntk on multiple GPUs ?
mpiexec is necessary to launch multi-GPU jobs.
(You can run independent jobs of course.)
Thanks,
Frank
From: such87 [mailto:[email protected]] Sent: Thursday, January 28, 2016 22:12 To: Microsoft/CNTK [email protected] Cc: Frank Seide [email protected] Subject: Re: [CNTK] Error with MNIST Dataset (#55)
Is it possible to run with multiple GPUs using only cntk ? Or do I have to use MPI to launch cntk on multiple GPUs ?
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/55#issuecomment-176594264.
If I run like this :
mpiexec -n 4 cntk Config/config_file deviceId=0
Then each process will run only on GPU 0. My platform is having 4 GPUs and I want each process to select a unique GPU like proc0 selects GPU0, proc1 selects GPU 1 and so on.
The code is failing with deviceId not set (which I guess defaults to auto). It generates the error that I first reported.
Is this a known issue ?
EXCEPTION occurred: DeviceFromConfig: unexpected failure
This may be due to not being able to write to /var/lock. I have refined the error message (will take a while to land).
Could you try if you can write to /var/lock? E.g.
echo test > /var/lock/test.txt
/var/lock is used to implement a global lock through the file system. If you do not have write access on your system, could you try to make it accessible for you? If that is not possible, a stopgap would be to manually edit CrossProcesMutex.h and change /var/lock to /tmp or something, and recompile. We have on our todo list to make this lock location configurable.
Tried changing /var/lock to lock on a local directory. Not helping, the same error occurs.
I get the same error even when I add deviceId=0 or deviceId=1. Note that I have two GPUs on my system. Is it resolved?
Original issue was solved, closing this.
@such87: can you retry the CIFAR-10 example? There should have been some fixes in the mean time addressing this. If it doesn't run, please open a new issue. Thank you! @such87, @saonim: for MPI execution, can you also try with the latest changes and post a new issue if it's still failing? Thank you...
For lock file location there already #62 to track.