Code Monkey home page Code Monkey logo

Comments (7)

js4ngu avatar js4ngu commented on July 17, 2024

I did a little test.
There seems to be a problem when a Tensor composed of integers is input.

import torch
import torch_stonne

print("TPU Test\n")
A = torch.randint(0, 10, (4, 1))
B = torch.randint(0, 10, (1, 4))
R = torch.matmul(A,B)

print("A :", A)
print("B :", B)
print("R : ")
print("PyTorch \n ",R)

print("STONNE\n")
r=torch_stonne.simulated_matmul("", A,  B, "../../simulation_files/maeri_128mses_128_bw.cfg", "test_tile.txt", 0)
print(r)

image

from stonne.

Adrian-2105 avatar Adrian-2105 commented on July 17, 2024

Hello,

Thanks for using STONNE. The purpose of the PyTorch Frontend is to be able to easily obtain the number of cycles required to compute each operation in the architecture. The number of cycles won't vary despite whether the result is correct or not. For that reason, the PyTorch Frontend actually only takes the main parameters from the tensors (dimensions, mainly) and uses them to initialize a random matrix and compute the operation using it. Thus, with the current implementation, it won't provide the correct output tensor for that operation. We are sorry about the inconvenience.

Hope this comment can help you.

from stonne.

js4ngu avatar js4ngu commented on July 17, 2024

So, is it impossible to compute an integer from STONNE?

from stonne.

Adrian-2105 avatar Adrian-2105 commented on July 17, 2024

Well, the only thing is that the PyTorch Frontend does not map directly the values of the input tensors into STONNE. With the current implementation, it's not possible then. We didn't consider this strictly necessary before, but if needed we can open a ticket to try to implement this feature in the future (but we can't promise since we are currently working on other projects)

from stonne.

js4ngu avatar js4ngu commented on July 17, 2024

If possible later, please.

I know this question is rude.
Do you happen to know a simulator that can also simulate the function of NPU (With cycle level simulate)?

from stonne.

stonne-simulator avatar stonne-simulator commented on July 17, 2024

Hello,

I am not aware of any other simulator. You could use the workaround of transforming the tensor from integer to float and process it on the simulator. Then you can convert again from float to integer. The simulation cycles will be the same as the size of the tensors will be identical. Does it make sense?

from stonne.

js4ngu avatar js4ngu commented on July 17, 2024

Thank you!

from stonne.

Related Issues (20)

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.