Coder Social home page Coder Social logo

tillife / infermo Goto Github PK

View Code? Open in Web Editor NEW
116.0 4.0 6.0 4.84 MB

Tensors and dynamic Neural Networks in Mojo

License: Apache License 2.0

autodiff automatic-differentiation ml modular mojo autograd-engine training neural-network autograd ai

infermo's People

Contributors

andresnowak avatar mikowals avatar tillife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

infermo's Issues

Mojo Parser Error, unable to locate old/new module

I have renamed the 'dv' directory to 'infermo', but after this even after clearing the git cache and recloning the entire repo, the parser throws an error on my computer when i try to compile. I have no idea why that is, any help would be appreciated. I am wondering if this happens on other machines as well?
Thx! :)

allow setting num_workers from command line

From working with llama2.mojo and some experimenting with the matmul demo notebook, I think there are probably some easy speed gains letting users set their own parallelisation level. The fastest level seems to be the number of cores or half the number of cores. Letting users set it is probably easiest and optimal.

In the matmul demo notebook where they use "over partitioning" (always setting the num_workers to the number of loops in parallelize) I got about a 40% speed up by hardcoding the num_workers argument to 32 instead. That is the number of cores the playground usually has available. So it wouldn't be too surprising to see that kind of speed up here.

training mnist example error

The error is as follows:

$mojo train_MNIST.mojo
[2352:2352:20231023,142308.047348:ERROR exception_handler_server.cc:361] getsockopt: Invalid argument (22)
[2350:2350:20231023,142308.047816:ERROR socket.cc:153] unhandled cmsg 0, 0
Failed to initialize Crashpad.  Crash reporting will not be available.  Cause: crashpad failed to start handler
Included from /home/maduo/Infermo/infermo/helpers/__init__.mojo:1:
/home/maduo/Infermo/infermo/helpers/dataLoader.mojo:1:1: error: unable to locate module 'dv'
from memory import memset_zero, memcpy
^
@"$dv"::@"$helpers"::@"$dataLoader"::@DataLoader
mojo: /__w/modular/modular/KGEN/include/KGEN/MojoParser/DeclResolver.h:164: M::KGEN::LIT::ASTDecl &M::KGEN::LIT::DeclResolver::getDeclForTypeSymbol(mlir::SymbolRefAttr) const: Assertion `it != declForTypeSymbol.end() && "Unknown decl symbol!"' failed.
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: mojo train_MNIST.mojo
1.      Crash resolving decl body at loc("/home/maduo/Infermo/train_MNIST.mojo":56:1)
    >> fn main() raises:
       ^................
    >>
    >>     # init
    >>     var dl = DataLoader('./infermo/datasets/mnist.txt')
       .......................................................<
2.      Crash parsing statement at loc("/home/maduo/Infermo/train_MNIST.mojo":59:5)
    >>     var dl = DataLoader('./infermo/datasets/mnist.txt')
           ^..................................................<
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo      0x00007fbb7c015a57
1  mojo      0x00007fbb7c01362e
2  mojo      0x00007fbb7c01612f
3  libc.so.6 0x00007fbb7b432520
4  libc.so.6 0x00007fbb7b486a7c pthread_kill + 300
5  libc.so.6 0x00007fbb7b432476 raise + 22
6  libc.so.6 0x00007fbb7b4187f3 abort + 211
7  libc.so.6 0x00007fbb7b41871b
8  libc.so.6 0x00007fbb7b429e96
9  mojo      0x00007fbb7c3ff6cd
10 mojo      0x00007fbb7c3ff538
11 mojo      0x00007fbb7c3ff85a
12 mojo      0x00007fbb7c436b79
13 mojo      0x00007fbb7c43796d
14 mojo      0x00007fbb7c488566
15 mojo      0x00007fbb7c44f8fc
16 mojo      0x00007fbb7c47449b
17 mojo      0x00007fbb7c46c154
18 mojo      0x00007fbb7c46c006
19 mojo      0x00007fbb7c420ad3
20 mojo      0x00007fbb7c418615
21 mojo      0x00007fbb7c4167f9
22 mojo      0x00007fbb7c3dcdbd
23 mojo      0x00007fbb7c3dd84b
24 mojo      0x00007fbb7bfdf1df
25 mojo      0x00007fbb7bfca63b
26 mojo      0x00007fbb7bfde138
27 mojo      0x00007fbb7bfc3dcd
28 libc.so.6 0x00007fbb7b419d90
29 libc.so.6 0x00007fbb7b419e40 __libc_start_main + 128
30 mojo      0x00007fbb7bfc335e
Aborted (core dumped)

mojo version:

mojo --version
[2366:2366:20231023,142716.532468:ERROR exception_handler_server.cc:361] getsockopt: Invalid argument (22)
[2364:2364:20231023,142716.533030:ERROR socket.cc:153] unhandled cmsg 0, 0
Failed to initialize Crashpad.  Crash reporting will not be available.  Cause: crashpad failed to start handler
mojo 0.4.0 (9e33b013)

system information:

$ uname -a
Linux PC-02-2020-0216 4.4.0-19041-Microsoft #3393-Microsoft Mon Aug 14 14:52:00 PST 2023 x86_64 x86_64 x86_64 GNU/Linux

snake_case instead of camelCase

In Python, the leading convention is to use PascalCase for class names, UPPER_SNAKE_CASE for constants and snake_case for everything else. Mojo as Python superset is following this rule and do not use camelCase at all. I suggest to make this consistent and adjust code :)

Please format with 'mojo format .'

I need to rebase once in a while, and most conflicts are due to unconventional layout mismatches.

Could you please format the code with 'mojo format .'. I also don't always agree with its decisions, but at least its conventional...

Regards.

Memory Leak

There seems to be a memory leak in the program, at the end of the test_infermo, the program uses sometimes 6gb of memory.

Kernel Fusion

I saw that you have changed how the forward operations work, now you execute the forward operation the moment it is added to the graph, but wouldn't it be better to do it the way it was before to be able to add the ability of kernel fusion and reducing the amount of memory used (reducing the amount of output memory tensors that are created), so basically to have lazy tensors.

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.