Git Product home page Git Product logo

hw3's People

Contributors

arav-agarwal2 avatar ashertrockman avatar leslierice1 avatar zwang86 avatar

Watchers

 avatar  avatar  avatar

hw3's Issues

test_matmul_tiled is never executed

Q5 has following line that runs local tests: !python3 -m pytest -v -k "matmul and cpu".

However this doesn't run test_matmul_tiled test.
To run this test one must add another notebook cell with command !python3 -m pytest -v -k "matmul_tiled"

I guess it's better to update existing line with the following !python3 -m pytest -v -k "matmul and cpu or matmul_tiled"

Getting this error while running tests

Steps to reproduce:

!python3 -m pytest -v -k "(permute or reshape or broadcast or getitem) and cpu and not compact"

Traceback:
../../../opt/anaconda3/envs/dlsys/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_ndarray.py:6: in
import needle as ndl
python/needle/init.py:1: in
from . import ops
python/needle/ops.py:5: in
from .autograd import NDArray
python/needle/autograd.py:12: in
from .backend_selection import Device, array_api, NDArray, default_device
python/needle/backend_selection.py:9: in
from . import backend_ndarray as array_api
python/needle/backend_ndarray/init.py:1: in
from .ndarray import *
python/needle/backend_ndarray/ndarray.py:6: in
from . import ndarray_backend_cpu
E ImportError: cannot import name 'ndarray_backend_cpu' from partially initialized module 'needle.backend_ndarray' (most likely due to a circular import) (/Users/talurj/Documents/dlsys/hw3/python/needle/backend_ndarray/init.py)

A bug in ndarray.py

In hw3/python/needle/backend_ndarray/ndarray.py, Row 299, there is code like this , "start = self.shape[dim]".

In my opinion, it should be "start = self.shape[dim] + start"

Enable Debug Info in `CMakeLists.txt`

For people who are not super familiar with pybind or cmake, if you want to generate the debug information for the shared library, you will need to comment the line pybind11_strip(ndarray_backend_cpu) and then compile it with regular cmake debug flag. Otherwise, the debug info will get stripped and you could not use debugging tools like (gdb, valgrind, etc.).

The wrong comment in ndarray_bakcend_cuda.cu

In src/ ndarray_bakcend_cuda.cu file, The comment of the parameter 'strides' and 'offset' with the function CompactKernel and Compact is not consistency.

CompactKernel:

*   strides: vector of strides of out array
*   offset: offset of out array

Compact:

* strides: strides of the *a* array (not out, which has compact strides)
*  offset: offset of the *a* array (not out, which has zero offset, being compact)

I think the parameters strides and offsets all belong to the input array "a".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.