# SameDiff

**URL:** https://community.konduit.ai/c/samediff/14.md

[Latest](https://community.konduit.ai/latest.md) · [Categories](https://community.konduit.ai/categories.md)

---

## [Problems using SameDiff? Read this first!](https://community.konduit.ai/t/problems-using-samediff-read-this-first/38)

<div class="topic-metadata">

**Author:** [@treo](https://community.konduit.ai/u/treo)\
**Replies:** 4\
**Last updated:** [November 16, 2021, 12:48pm UTC](https://community.konduit.ai/t/problems-using-samediff-read-this-first/38 "2021-11-16T12:48:46Z")

</div>

SameDiff is the JVM equivalent to Tensorflow and PyTorch. Use it for automatic derivation or to import pre-existing models from other frameworks. The documentation for SameDiff is currently pretty sparse. Still, before …

---

## [How would you implement weight sharing?](https://community.konduit.ai/t/how-would-you-implement-weight-sharing/3537)

<div class="topic-metadata">

**Author:** [@Lana](https://community.konduit.ai/u/Lana)\
**Replies:** 3\
**Last updated:** [August 26, 2026, 10:44am UTC](https://community.konduit.ai/t/how-would-you-implement-weight-sharing/3537 "2026-08-26T10:44:07Z")

</div>

I am implementing a famous model where you have in python with tf.GradientTape() as g: for i in tf.range(60): x = model(x) loss = tf.reduce\_mean(loss\_f(x)) grads = g.gradient(loss, model.weights) Pytho…

---

## [Why is mini batch size passed to the shape of placeholders?](https://community.konduit.ai/t/why-is-mini-batch-size-passed-to-the-shape-of-placeholders/3432)

<div class="topic-metadata">

**Author:** [@Cezar](https://community.konduit.ai/u/Cezar)\
**Replies:** 5\
**Last updated:** [March 20, 2026, 8:19am UTC](https://community.konduit.ai/t/why-is-mini-batch-size-passed-to-the-shape-of-placeholders/3432 "2026-03-20T08:19:32Z")

</div>

Maybe a dumb question, but I thought that the dataset object contain mini batches, and batching is handled by the training functiin

---

## [NullPointerException org.nd4j.autodiff.samediff.internal.Variable.getOutputOfOp()](https://community.konduit.ai/t/nullpointerexception-org-nd4j-autodiff-samediff-internal-variable-getoutputofop/3278)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 173\
**Last updated:** [March 7, 2026, 9:09pm UTC](https://community.konduit.ai/t/nullpointerexception-org-nd4j-autodiff-samediff-internal-variable-getoutputofop/3278 "2026-03-07T21:09:42Z")

</div>

Hi, I am finally back to working on my implementation of " Attention Is All You Need" model and made good progress (I think). However, now I have run into a problem I am stuck on. Below, you will find the error log. P…

---

## [When will be the end time to support 1080 ti?](https://community.konduit.ai/t/when-will-be-the-end-time-to-support-1080-ti/3411)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 3\
**Last updated:** [January 21, 2026, 1:02am UTC](https://community.konduit.ai/t/when-will-be-the-end-time-to-support-1080-ti/3411 "2026-01-21T01:02:38Z")

</div>

When will be the end time to support 1080 ti ?

---

## [New PRs not sychronized to main](https://community.konduit.ai/t/new-prs-not-sychronized-to-main/3408)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 4\
**Last updated:** [January 7, 2026, 8:27pm UTC](https://community.konduit.ai/t/new-prs-not-sychronized-to-main/3408 "2026-01-07T20:27:29Z")

</div>

seems the new 41 PRs have finished, why not merge them to main?

---

## [Float16 use gives cuda 700 error](https://community.konduit.ai/t/float16-use-gives-cuda-700-error/3401)

<div class="topic-metadata">

**Author:** [@markiemark](https://community.konduit.ai/u/markiemark)\
**Replies:** 3\
**Last updated:** [October 6, 2025, 9:42am UTC](https://community.konduit.ai/t/float16-use-gives-cuda-700-error/3401 "2025-10-06T09:42:46Z")

</div>

I have implemented a PSFormer using SameDiff, and it seems to work using dtype FLOAT. Hoping to get some faster training I tried with FLOAT16 (HALF) but run into cuda 700 errors. I’ve narrowed it down to the initial weig…

---

## [Not try to release new version now?](https://community.konduit.ai/t/not-try-to-release-new-version-now/3400)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 1\
**Last updated:** [September 25, 2025, 8:27pm UTC](https://community.konduit.ai/t/not-try-to-release-new-version-now/3400 "2025-09-25T20:27:28Z")

</div>

Not try to release new version now?

---

## [The new version can't be released?](https://community.konduit.ai/t/the-new-version-cant-be-released/3372)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 5\
**Last updated:** [July 4, 2025, 9:57am UTC](https://community.konduit.ai/t/the-new-version-cant-be-released/3372 "2025-07-04T09:57:10Z")

</div>

The new version can’t be released?

---

## [Does DL4J support cuda 12.x?](https://community.konduit.ai/t/does-dl4j-support-cuda-12-x/3363)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 3\
**Last updated:** [May 30, 2025, 7:01am UTC](https://community.konduit.ai/t/does-dl4j-support-cuda-12-x/3363 "2025-05-30T07:01:04Z")

</div>

the highest version is 11.6 in Index of /repositories/snapshots/org/nd4j

---

## [Does DL4J support lora training?](https://community.konduit.ai/t/does-dl4j-support-lora-training/3362)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 1\
**Last updated:** [May 20, 2025, 12:22pm UTC](https://community.konduit.ai/t/does-dl4j-support-lora-training/3362 "2025-05-20T12:22:20Z")

</div>

Does DL4J support lora training? for normal DL such yolo11 etc or LLM.

---

## [SameDiff optimizer](https://community.konduit.ai/t/samediff-optimizer/3297)

<div class="topic-metadata">

**Author:** [@roman](https://community.konduit.ai/u/roman)\
**Replies:** 9\
**Last updated:** [December 12, 2024, 7:48am UTC](https://community.konduit.ai/t/samediff-optimizer/3297 "2024-12-12T07:48:03Z")

</div>

Hello. I am trying to similar to tensoflow working code with SameDiff. So, tenflow code: obs\_ph = tf.placeholder(shape=(None, obs\_dim\[0\]), dtype=tf.float32, name='obs') act\_ph = tf.placeholder(shape=(None, ), d…

---

## [Unable To Import DistilBERT With OnnxFrameworkImporter](https://community.konduit.ai/t/unable-to-import-distilbert-with-onnxframeworkimporter/3210)

<div class="topic-metadata">

**Author:** [@sadcaptcha](https://community.konduit.ai/u/sadcaptcha)\
**Replies:** 1\
**Last updated:** [August 19, 2024, 11:39am UTC](https://community.konduit.ai/t/unable-to-import-distilbert-with-onnxframeworkimporter/3210 "2024-08-19T11:39:34Z")

</div>

I am trying to use the OnnxFrameworkImporter to import DistilBERT, with no luck. It seems like some operations are not recognized. Here’s the model I’m trying to import: philschmid/distilbert-onnx at main Code: impor…

---

## [The Loss of the SameDiff converges to the same value](https://community.konduit.ai/t/the-loss-of-the-samediff-converges-to-the-same-value/3202)

<div class="topic-metadata">

**Author:** [@cqiaoYc](https://community.konduit.ai/u/cqiaoYc)\
**Replies:** 3\
**Last updated:** [August 6, 2024, 6:54am UTC](https://community.konduit.ai/t/the-loss-of-the-samediff-converges-to-the-same-value/3202 "2024-08-06T06:54:51Z")

</div>

@agibsonccc I implemented an sLSTM ( xLSTM) model with residual network using SameDiff’s. However, the loss always converges to the same value, and the graph page in uiServer does not display any content. Can you help me…

---

## [How do I train SameDiff using multiple GPUs?](https://community.konduit.ai/t/how-do-i-train-samediff-using-multiple-gpus/3200)

<div class="topic-metadata">

**Author:** [@cqiaoYc](https://community.konduit.ai/u/cqiaoYc)\
**Replies:** 1\
**Last updated:** [July 27, 2024, 9:12am UTC](https://community.konduit.ai/t/how-do-i-train-samediff-using-multiple-gpus/3200 "2024-07-27T09:12:13Z")

</div>

Where can I find relevant examples? Thank you!

---

## [SameDiff UI visualization](https://community.konduit.ai/t/samediff-ui-visualization/2788)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 3:02pm UTC](https://community.konduit.ai/t/samediff-ui-visualization/2788 "2024-07-26T15:02:07Z")

</div>

The UI configuration/set-up for ND4J (see link below) does not seem to work for SameDiff. I could not find anywhere in the documentation or code examples/tests that show me how to set-up visualization when using SameDiff…

---

## [Python4J Cannot find the customized Python path in miniconda](https://community.konduit.ai/t/python4j-cannot-find-the-customized-python-path-in-miniconda/1861)

<div class="topic-metadata">

**Author:** [@Anakin](https://community.konduit.ai/u/Anakin)\
**Replies:** 13\
**Last updated:** [December 14, 2023, 7:18am UTC](https://community.konduit.ai/t/python4j-cannot-find-the-customized-python-path-in-miniconda/1861 "2023-12-14T07:18:33Z")

</div>

Dear Community, Recently, I’m trying to integrate my Pytorch models in the DL4J environment. Since my Pytorch models require additional modules, I need to create a virtual environment to import all dependencies. As sh…

---

## [Same input got different ouput for BERT import in M2.1](https://community.konduit.ai/t/same-input-got-different-ouput-for-bert-import-in-m2-1/2850)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 2\
**Last updated:** [October 11, 2023, 1:02pm UTC](https://community.konduit.ai/t/same-input-got-different-ouput-for-bert-import-in-m2-1/2850 "2023-10-11T13:02:35Z")

</div>

Do you have BERT model? Could you please help to check if the same sentence can get the same output INArray values? I imported BERT but got different values.

---

## [Application fatal error exit code 134](https://community.konduit.ai/t/application-fatal-error-exit-code-134/2839)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 8\
**Last updated:** [October 9, 2023, 6:30am UTC](https://community.konduit.ai/t/application-fatal-error-exit-code-134/2839 "2023-10-09T06:30:00Z")

</div>

Hi, My code is failing with an error I do not understand. Please see below. I searched for information on this error without much luck. Have you seen it before? Any suggestions on how to proceed to solve it? Thanks E…

---

## [Assign value to a placeholder](https://community.konduit.ai/t/assign-value-to-a-placeholder/2633)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 55\
**Last updated:** [September 24, 2023, 4:54pm UTC](https://community.konduit.ai/t/assign-value-to-a-placeholder/2633 "2023-09-24T16:54:13Z")

</div>

Hi, This may be nonsensical and show that I don’t really understand how samediff works. Could I assign a value to a placeholder? How? I have searched through the code and documentation but could not find a way to do t…

---

## [Import Pytorch model in ONNX format](https://community.konduit.ai/t/import-pytorch-model-in-onnx-format/2789)

<div class="topic-metadata">

**Author:** [@minyueyong](https://community.konduit.ai/u/minyueyong)\
**Replies:** 6\
**Last updated:** [September 21, 2023, 6:56am UTC](https://community.konduit.ai/t/import-pytorch-model-in-onnx-format/2789 "2023-09-21T06:56:19Z")

</div>

Hi , I have a YOLOv8 Pytorch Model that I converted to ONNX format to be imported but I am hitting this error Is there something I can do to fix this or is it not supported??

---

## [Use dl4j is slow to load pre-trained model is slow](https://community.konduit.ai/t/use-dl4j-is-slow-to-load-pre-trained-model-is-slow/2821)

<div class="topic-metadata">

**Author:** [@Herminone-xueyan](https://community.konduit.ai/u/Herminone-xueyan)\
**Replies:** 2\
**Last updated:** [September 15, 2023, 2:05am UTC](https://community.konduit.ai/t/use-dl4j-is-slow-to-load-pre-trained-model-is-slow/2821 "2023-09-15T02:05:55Z")

</div>

I use resnet model which downloaded from tf hub, the size is 214M; it take more than 10mins to load each time, can someont tell me why it’s taking so long?very thankful

---

## [SameDiff Normalization](https://community.konduit.ai/t/samediff-normalization/2824)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 1\
**Last updated:** [September 14, 2023, 4:22pm UTC](https://community.konduit.ai/t/samediff-normalization/2824 "2023-09-14T16:22:22Z")

</div>

Hi, I have been looking for the base operation to implement normalization in SameDiff. This does not include any info on normalization in SameDiff (not that I could find). I have implemented my own but it does not w…

---

## [Sd.evaluate failure](https://community.konduit.ai/t/sd-evaluate-failure/2784)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 0\
**Last updated:** [August 20, 2023, 8:05pm UTC](https://community.konduit.ai/t/sd-evaluate-failure/2784 "2023-08-20T20:05:46Z")

</div>

When I run the code reported below, execution fails with Index can't be \< 0 and \>= 1984 outReduced has shape \[64, 2, 31\] testData has 109 elements. What am I missing / doing wrong? Thanks CODE Stri…

---

## [Error on saving large SameDiff model with FlatBuffers](https://community.konduit.ai/t/error-on-saving-large-samediff-model-with-flatbuffers/578)

<div class="topic-metadata">

**Author:** [@weinino](https://community.konduit.ai/u/weinino)\
**Replies:** 5\
**Last updated:** [August 19, 2023, 1:28pm UTC](https://community.konduit.ai/t/error-on-saving-large-samediff-model-with-flatbuffers/578 "2023-08-19T13:28:12Z")

</div>

Hi I have a BERT model in SameDiff, that I would like to save using the normal “save” method provided by SameDiff. However, I get the following error as a result of the FlatBuffers maximum size: Caused by: java.lang.As…

---

## [Missing SD variable issue](https://community.konduit.ai/t/missing-sd-variable-issue/2780)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 9\
**Last updated:** [August 15, 2023, 9:43pm UTC](https://community.konduit.ai/t/missing-sd-variable-issue/2780 "2023-08-15T21:43:20Z")

</div>

Hi, I completed the initial implementation of the “Attention Is All You Need” model and have started debugging training/testing. I perform sd.fit one dataset at a time. Processing of the first dataset completes withou…

---

## [Broadcastable variables and arrays](https://community.konduit.ai/t/broadcastable-variables-and-arrays/2758)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 1\
**Last updated:** [August 10, 2023, 12:31am UTC](https://community.konduit.ai/t/broadcastable-variables-and-arrays/2758 "2023-08-10T00:31:21Z")

</div>

Hi, I have read all the documentation about broadcast and searched on the web for “nd4j broadcast”. I could not find any information to help me resolve this error: shapes are not equal and are not broadcastable The o…

---

## [Finetune onnx model](https://community.konduit.ai/t/finetune-onnx-model/2739)

<div class="topic-metadata">

**Author:** [@Booker](https://community.konduit.ai/u/Booker)\
**Replies:** 8\
**Last updated:** [August 6, 2023, 7:33am UTC](https://community.konduit.ai/t/finetune-onnx-model/2739 "2023-08-06T07:33:28Z")

</div>

Can I retrain some layers in onnx model by SameDiff? Is there an example?

---

## [Reusing SD variables](https://community.konduit.ai/t/reusing-sd-variables/2709)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 5\
**Last updated:** [July 31, 2023, 10:59am UTC](https://community.konduit.ai/t/reusing-sd-variables/2709 "2023-07-31T10:59:36Z")

</div>

Hi, I suspect the latest problem I have run into is another case of my not fully understanding SameDiff and misusing it. I have a created a class to create the multi-head attention layer for encoder and decoder. At one…

---

## [Modifying SD variables](https://community.konduit.ai/t/modifying-sd-variables/2685)

<div class="topic-metadata">

**Author:** [@adonnini](https://community.konduit.ai/u/adonnini)\
**Replies:** 9\
**Last updated:** [July 20, 2023, 11:02pm UTC](https://community.konduit.ai/t/modifying-sd-variables/2685 "2023-07-20T23:02:04Z")

</div>

I would like to understand if and how SD variables once created can be modified. I have a couple of specific questions. if I define an SD variable like this: SDVariable x = new SDVariable(); is x.setArray(y); (y is…

[Next page](https://community.konduit.ai/c/samediff/14.md?page=1)
