moazreyad commented on code in PR #1383:
URL: https://github.com/apache/singa/pull/1383#discussion_r3522906163


##########
examples/singa_peft/examples/data/download_mnist.py:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import os
+import urllib.request
+
+
+def check_exist_or_download(url):
+
+    download_dir = '/tmp/'  # downloaded to the /tmp/ folder

Review Comment:
   `download_dir` is currently hard-coded to `/tmp/`, but the PEFT MNIST loader 
defaults to `/tmp/mnist` and expects the dataset files under that directory:
   
   - Default dataset path: 
https://github.com/eyumboo/singa/blob/dev-postgresql/examples/singa_peft/examples/data/mnist.py#L85
  
   - File lookup logic assumes `/tmp/mnist`: 
https://github.com/eyumboo/singa/blob/dev-postgresql/examples/singa_peft/examples/data/mnist.py#L38
  
   
   In addition, the example runner explicitly passes `-dir /tmp/mnist`:  
   
https://github.com/eyumboo/singa/blob/dev-postgresql/examples/singa_peft/examples/run.sh#L21
  
   
   Because of this mismatch, even after running the new downloader, training 
fails since it looks for files like `/tmp/mnist/train-images-idx3-ubyte.gz`, 
which are not present.
   
   It would be better if the downloader:
   
   - Writes directly to `/tmp/mnist` (and creates the directory if it doesn’t 
exist)
   - Ideally supports the same `--dir-path` argument used by the training 
pipeline for consistency



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to