Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 72e1755

Browse files
authored
fixing reshape communication (#26)
* fixing reshape communication. Together with new imex tests now pass with 3 and for ranks * workaround for long filepaths in CI
1 parent a709574 commit 72e1755

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,24 @@ jobs:
122122
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
123123
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate ddpt
124124
MLIRROOT=$GITHUB_WORKSPACE/third_party/install/llvm-mlir IMEXROOT=$GITHUB_WORKSPACE/third_party/install/imex python setup.py install
125-
DDPT_ROOT=`pip show -f ddptensor | grep Location | awk '{print $2}'`
126-
echo "DDPT_IDTR_SO=${DDPT_ROOT}/ddptensor/libidtr.so" >> $GITHUB_ENV
125+
# DDPT_ROOT=`pip show -f ddptensor | grep Location | awk '{print $2}'`
126+
# for some reason we cannot use the idtr from the install, not even a copy works
127+
libidtr=`ls ${PWD}/build/lib.linux-x86_64-cpython-*/ddptensor/libidtr.so`
128+
echo "DDPT_IDTR_SO=${libidtr}" >> $GITHUB_ENV
127129
echo "DDPT_CRUNNER_SO=${GITHUB_WORKSPACE}/third_party/install/llvm-mlir/lib/libmlir_c_runner_utils.so" >> $GITHUB_ENV
130+
echo $DDPT_IDTR_SO
128131
- name: Test DDPT (pytest)
129132
run: |
130133
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
131134
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate ddpt
132135
cd test
133-
pytest .
134-
DDPT_FORCE_DIST=1 pytest .
135-
mpirun -n 2 pytest .
136+
echo $DDPT_IDTR_SO
137+
ldd $DDPT_IDTR_SO
138+
pytest . -v -s
139+
DDPT_FORCE_DIST=1 pytest . -v -s
140+
mpirun -n 2 pytest . -v -s
141+
mpirun -n 3 pytest . -v -s
142+
mpirun -n 4 pytest . -v -s
136143
cd -
137144
- name: Run examples
138145
run: |

imex_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2726c17193e3297a5442ba507ba560133723ac09
1+
c86b38a055b73c9041ca38dd36760fa11d3d5b9f

src/idtr.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void copy_(uint64_t d, uint64_t &pos, T *cptr, const int64_t *sizes,
224224
uint64_t first = 0;
225225
if (pos < start) {
226226
first = (start - pos) / chunk;
227-
pos += first;
227+
pos += first * chunk;
228228
cptr += first * stride;
229229
assert(pos <= start && pos < end);
230230
}
@@ -281,9 +281,11 @@ template <typename T>
281281
void _idtr_reduce_all(int64_t dataRank, void *dataDescr, int op) {
282282
UnrankedMemRefType<T> data(dataRank, dataDescr);
283283
assert(dataRank == 0 || (dataRank == 1 && data.strides()[0] == 1));
284-
getTransceiver()->reduce_all(
285-
data.data(), DTYPE<T>::value, dataRank ? data.sizes()[0] : 1,
286-
mlir2ddpt(static_cast<imex::ptensor::ReduceOpId>(op)));
284+
auto d = data.data();
285+
auto t = DTYPE<T>::value;
286+
auto r = dataRank ? data.sizes()[0] : 1;
287+
auto o = mlir2ddpt(static_cast<imex::ptensor::ReduceOpId>(op));
288+
getTransceiver()->reduce_all(d, t, r, o);
287289
}
288290

289291
extern "C" {

0 commit comments

Comments
 (0)