Like ptrblock says, you have to generate conv/pool configuration before committing to it and mimic the calculations of the pool / conv layers in your NAS so that you disregard upfront the configuration candidates that pool too much or stride to much to end up with a positive input size at the end.
In this way you can prune bad configs early, as well as generate them much quicker.
You’ll want to know that to calculate the output size of your tensor through the conv layer (how it looks for conv1d at least),
L_out = floor((L_in + 2 * padding - dilation * (kernel_size - 1) - 1) / stride + 1)
Also, pooling of course divides the output size by its stride.
Also I’d skip the randomizing of the padding, and just use:
padding = ceil(kernel_size - stride) // 2
That will narrow your hyper-parameter space a bit without sacrificing much.