alibaba / alibaba/GraphScope

[Feature] Consider using a decorator `@graphscope.nx.accelerate` or something like that for networkx APIs

Open
#1,534 1 comment 1 reaction 1 assignee Claimed by @acezen View on GitHub
component:networkx enhancement
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

**Describe the bug**

I occasionally read a blog about `bodo` (https://github.com/Bodo-inc/Bodo-tutorial/blob/master/bodo_tutorial.ipynb), and noticed that the API is quite promising, e.g.,

```python
import numpy as np
import pandas as pd
import bodo

@bodo.jit()
def f(n, a):
df = pd.DataFrame({"A": np.arange(n) + a})
return df
```

Note that people are still write `pd....` and the decorator would do everything under the hood. The syntax looks quite concise and pythonic! (compare with modifying the `import` statement).

We already do something similar works in our test suite, where a `import_as_graphscope_nx()` would recursively rewrite all occurrence of `nx` to `graphscope.nx` in a module (in all classes and functions). Thus the implementation shouldn't be hard.

As a side (but more important) side effect, such a design may bring more opportunity for a whole program optimization, e.g., we would certainly know the access pattern of an edge/vertex iterator.

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.