Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CONTRIBUTING_MAC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing As a Mac User

## Installation

For M1 Macs (Apple Silicon), various [online sources](https://github.com/scipy/scipy/issues/13409) recommend using OpenBLAS as a native (not Rosetta) linear algebra backend for dependencies like NumPy.
```sh
brew install openblas
export OPENBLAS=$(/opt/homebrew/bin/brew --prefix openblas)
```

As [documented by Ray](https://docs.ray.io/en/latest/ray-overview/installation.html#m1-mac-apple-silicon-support), one must install miniforge, a community-driven Conda installer, for packages that support `arm64`. In particular, the GRPCIO package from pip will not work with Ray, so it must be uninstalled (`pip uninstall grpcio`) and replaced with the one from miniforge (`conda install grpcio`).


## Testing

`tests/core/backend/test_backend_init.py::test_head_detection`
As [documented by Ray](https://github.com/ray-project/ray/issues/24130), there is different default behavior for fetching node IP addresses. On Linux, a private address (e.g. `192.168.0.1`) is returned, while on Windows and Mac, `127.0.0.1` is returned. As NumS is primarily released for Linux, this test will fail for Mac contributors, but it shouldn't affect development.
10 changes: 7 additions & 3 deletions nums/core/array/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ def loadtxt(
def scalar(self, value):
return BlockArray.from_scalar(value, self.km)

def array(self, array: Union[np.ndarray, sparse.COO, List[float]], block_shape: tuple = None):
def array(
self,
array: Union[np.ndarray, sparse.COO, List[float]],
block_shape: tuple = None,
):
if not isinstance(array, (np.ndarray, sparse.COO)):
if array_utils.is_array_like(array):
array = np.array(array)
Expand Down Expand Up @@ -917,7 +921,7 @@ def map_uop(
# TODO(hme): Faster to create ndarray first,
# and instantiate block array on return
# to avoid instantiating blocks on BlockArray initialization.
rarr.blocks[grid_entry] = arr.blocks[grid_entry].uop_map(
rarr.blocks[grid_entry] = arr.blocks[grid_entry].map_uop(
op_name, args=args, kwargs=kwargs
)
return rarr
Expand All @@ -928,7 +932,7 @@ def matmul(self, arr_1: BlockArray, arr_2: BlockArray) -> BlockArray:
def tensordot(
self, arr_1: BlockArray, arr_2: BlockArray, axes: int = 2
) -> BlockArray:
return arr_1.tensordot(arr_2, axes)
return arr_1.tensordot(arr_1, arr_2, axes)

def einsum(self, subscript, *operands):
def _compute_syskwargs(blocks):
Expand Down
Loading