Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move numeric_types.py from fud/verilator to calyx-py (another attempt at #1715 ) #1719

Merged
merged 8 commits into from
Feb 5, 2024

Conversation

calebmkim
Copy link
Contributor

This is another attempt at #1715. I merged #1715 without realizing that it would mess up Docker (see this error).

Therefore, I reverted the merge. I have reopened another PR that does the exact same thing as #1715. I would like to merge it, but first have to figure out why the Docker stuff was failing.

Apologies for this being so confusing.

Copy link
Contributor

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a reasonable thing to do! I don't yet see why this would break anything Docker-related, unfortunately…

@@ -8,9 +8,8 @@
)
from calyx.utils import float_to_fixed_point
from math import factorial, log2
from fud.stages.verilator import numeric_types
from calyx.numeric_types import FixedPoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a great outcome here that the calyx-py library doesn't need to depend on fud for this. That direction of dependency was always extremely weird.

@@ -3,8 +3,7 @@
from pathlib import Path
import simplejson as sjson
import numpy as np
from fud.stages.verilator.numeric_types import FixedPoint, Bitnum
from fud.errors import InvalidNumericType
from calyx.numeric_types import FixedPoint, Bitnum, InvalidNumericType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be described as slightly weird, although not overwhelmingly weird, that fud depends on calyx-py now. Like, if you think of the calyx-py library as being for generating code, it's not clear why fud would need that. But actually, calyx-py currently is sort of sprawling and covers lots of things, including all our individual code generators (it is not just a code generation library). Therefore this doesn't seem like much messier than it was before, so I think it's fine!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think we should eventually externalize all these stages from the core logic in fud so that these false dependencies can be eliminated. The fud API is rich enough that we don't actually need to have these stages sitting in the definition of fud itself anymore.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea to have all stages be external then? Or rather to get rid of the notion of non-external stages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd say barring any API problems, there should be no internal stages whatsoever.

@rachitnigam
Copy link
Contributor

@calebmkim Anything blocking us from merging this?

@calebmkim
Copy link
Contributor Author

Docker fails when I tried to push this.
When it tries to build Docker it gives an error: ModuleNotFoundError: No module named 'calyx'. Which is from the new fud dependency on calyx.numeric_types

@rachitnigam
Copy link
Contributor

@calebmkim let's try to get this merged? Hopefully the new docker image stuff allows this to be tested correctly?

@calebmkim
Copy link
Contributor Author

Ok, I'll try to merge (if it still doesn't work I can revert the change).

@calebmkim calebmkim merged commit cf710a5 into main Feb 5, 2024
7 checks passed
@calebmkim calebmkim deleted the systolic-cleanup branch February 5, 2024 19:41
rachitnigam added a commit that referenced this pull request Feb 16, 2024
…ttempt at #1715 )  (#1719)

* refactor numeric types

* moved test

* changed error location

* fix test location

---------

Co-authored-by: Rachit Nigam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants