Unexpected assertion error for gradient of ppermute.
The following code produces an assertion error:

```
import jax

def ppermute(input):
  return jax.lax.ppermute(input, axis_name="i", perm=[[0, 1], [1, 0]])

grad_fn = jax.grad(ppermute)

vmapped_gradients_fn = jax.vmap(grad_fn, axis_name="i")
  
vector = jax.numpy.array([1., 2.])
grads = vmapped_gradients_fn(vector)
```

```
AssertionError                            Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/jax/_src/lax/parallel.py in _ppermute_batcher(axis_size, frame_name, _, vals_in, dims_in, axis_name, perm)
    791   assert axis_name[0] == frame_name, "ppermute batcher called with a wrong axis!"
    792   assert len(perm) == axis_size, "Permutation doesn't match the axis size!"
--> 793   assert d is not batching.not_mapped
    794   perm_indices = np.zeros(axis_size, dtype=int)
    795   for src, dst in perm:
```


Interestingly, the assertion error goes away, if I just inject a constant vector of ones:

```
import jax

def ppermute(input, one):
  return one * jax.lax.ppermute(input, axis_name="i", perm=[[0, 1], [1, 0]])

grad_fn = jax.grad(ppermute)

vmapped_gradients_fn = jax.vmap(grad_fn, axis_name="i")
  
vector = jax.numpy.array([1., 2.])
ones = jax.numpy.ones([2])
grads = vmapped_gradients_fn(vector, ones)
print(grads)  # [1. 1.]
```

This makes me believe the assert triggering above may indicate a bug.

diff --git a/jax/_src/lax/parallel.py b/jax/_src/lax/parallel.py
index cd2e04c28..6a123f721 100644
--- a/jax/_src/lax/parallel.py
+++ b/jax/_src/lax/parallel.py
@@ -793,7 +793,8 @@ def _ppermute_batcher(axis_size, frame_name, _, vals_in, dims_in, axis_name, per
     raise NotImplementedError("ppermute batcher only supports a single axis")
   assert axis_name[0] == frame_name, "ppermute batcher called with a wrong axis!"
   assert len(perm) == axis_size, "Permutation doesn't match the axis size!"
-  assert d is not batching.not_mapped
+  if d is batching.not_mapped:
+    return v, d
   perm_indices = np.zeros(axis_size, dtype=int)
   for src, dst in perm:
     perm_indices[dst] = src
diff --git a/tests/batching_test.py b/tests/batching_test.py
index e822a9d06..bb6f2a72d 100644
--- a/tests/batching_test.py
+++ b/tests/batching_test.py
@@ -1267,6 +1267,19 @@ class BatchingTest(jtu.JaxTestCase):
     self.assertEqual(f(jnp.ones(3)).shape, (3,))
     self.assertEqual(jax.vmap(f)(jnp.ones((2, 3))).shape, (2, 3))
 
+  def testPpermuteBatcherTrivial(self):
+    # https://github.com/google/jax/issues/8688
+    def ppermute(input):
+      return jax.lax.ppermute(input, axis_name="i", perm=[[0, 1], [1, 0]])
+
+    grad_fn = jax.grad(ppermute)
+
+    vmapped_gradients_fn = jax.vmap(grad_fn, axis_name="i")
+
+    vector = jax.numpy.array([1., 2.])
+    ans = vmapped_gradients_fn(vector)  # doesn't crash
+    self.assertAllClose(ans, jnp.ones(2), check_dtypes=False)
+
 
 Array = Any
 ArrayElt = Any
['jax/_src/lax/parallel.py', 'tests/batching_test.py']